]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/mda.t
searchidx: index lower-case List-Id value
[public-inbox.git] / t / mda.t
diff --git a/t/mda.t b/t/mda.t
index 759c0b020abc661addd2752787e9c95c62ea0b5c..c5b35eec21cf40d30a5c0dc2abc829afab7b05d5 100644 (file)
--- a/t/mda.t
+++ b/t/mda.t
@@ -261,7 +261,7 @@ Subject: this message will be trained as spam
 Date: Thu, 01 Jan 1970 00:00:00 +0000
 
 EOF
-       xsys(qw(git config --file), $pi_config, "$cfgpfx.listid", $list_id);
+       xsys(qw(git config --file), $pi_config, "$cfgpfx.listid", uc $list_id);
        $? == 0 or die "failed to set listid $?";
        ok(run_script(['-mda'], undef, { 0 => \$in }),
                'mda OK with List-Id match');
@@ -299,9 +299,17 @@ EOF
        ok(run_script(['-mda'], undef, $rdr),
                'mda OK with multiple List-Id matches');
        $cur = $git->qx(qw(diff HEAD~1..HEAD));
-       like($cur, qr/Message-ID: <2lids\@example>/,
+       like($cur, qr/^\+Message-ID: <2lids\@example>/sm,
                'multi List-ID match delivered');
        like($err, qr/multiple List-ID/, 'warned about multiple List-ID');
+
+       # ensure -learn rm works after inbox address is updated
+       ($out, $err) = ('', '');
+       xsys(qw(git config --file), $pi_config, "$cfgpfx.address",
+               'updated-address@example.com');
+       ok(run_script(['-learn', 'rm'], undef, $rdr), 'rm-ed via -learn');
+       $cur = $git->qx(qw(diff HEAD~1..HEAD));
+       like($cur, qr/^-Message-ID: <2lids\@example>/sm, 'changed in git');
 }
 
 done_testing();