about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-20 20:56:22 +0000
committerEric Wong <e@80x24.org>2019-01-20 20:59:30 +0000
commitcfa8ff7c256e20f3240aed5f98d155c019788e3b (patch)
treefe84723f841eb42b404ba8532646dd1ce3291796 /t
parentfd51d748fa140bde55340789cb44f01e687f1e3d (diff)
downloadpublic-inbox-cfa8ff7c256e20f3240aed5f98d155c019788e3b.tar.gz
For cross-inbox Message-ID resolution; having some sort of
stable ordering makes the most sense.  Relying on the
order of the config file seems most natural and allows us
to avoid introducing yet another configuration knob.
Diffstat (limited to 't')
-rw-r--r--t/config.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/config.t b/t/config.t
index 5f0a95ba..7531fd75 100644
--- a/t/config.t
+++ b/t/config.t
@@ -150,4 +150,23 @@ for my $s (@valid) {
         ok(PublicInbox::Config::valid_inbox_name($s), "$d name accepted");
 }
 
+{
+        my $f = "$tmpdir/ordered";
+        open my $fh, '>', $f or die "open: $!";
+        my @expect;
+        foreach my $i (0..3) {
+                push @expect, "$i";
+                print $fh <<"" or die "print: $!";
+[publicinbox "$i"]
+        mainrepo = /path/to/$i.git
+        address = $i\@example.com
+
+        }
+        close $fh or die "close: $!";
+        my $cfg = PublicInbox::Config->new($f);
+        my @result;
+        $cfg->each_inbox(sub { push @result, $_[0]->{name} });
+        is_deeply(\@result, \@expect);
+}
+
 done_testing();