From 1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Oct 2019 00:38:06 +0000 Subject: config: we always have {-section_order} Rewrite a bunch of tests to use ordered input (emulating "git config -l" output) so we can always walk sections in the order they were given in the config file. --- t/watch_maildir_v2.t | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 't/watch_maildir_v2.t') diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t index f1d6e740..0a5a8017 100644 --- a/t/watch_maildir_v2.t +++ b/t/watch_maildir_v2.t @@ -40,14 +40,14 @@ ok(POSIX::mkfifo("$maildir/cur/fifo", 0777), 'create FIFO to ensure we do not get stuck on it :P'); my $sem = PublicInbox::Emergency->new($spamdir); # create dirs -my %orig = ( - "$cfgpfx.address" => $addr, - "$cfgpfx.mainrepo" => $mainrepo, - "$cfgpfx.watch" => "maildir:$maildir", - "$cfgpfx.filter" => 'PublicInbox::Filter::Vger', - "publicinboxlearn.watchspam" => "maildir:$spamdir" -); -my $config = PublicInbox::Config->new({%orig}); +my $orig = <new(\$orig); my $ibx = $config->lookup_name('test'); ok($ibx, 'found inbox by name'); my $srch = $ibx->search; @@ -146,12 +146,12 @@ More majordomo info at http://vger.kernel.org/majordomo-info.html\n); my $v1pfx = "publicinbox.v1"; my $v1addr = 'v1-public@example.com'; is(system(qw(git init -q --bare), $v1repo), 0, 'v1 init OK'); - my $config = PublicInbox::Config->new({ - %orig, - "$v1pfx.address" => $v1addr, - "$v1pfx.mainrepo" => $v1repo, - "$v1pfx.watch" => "maildir:$maildir", - }); + my $cfg2 = <new(\$cfg2); my $both = <