about summary refs log tree commit homepage
path: root/t/altid_v2.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-30 09:21:40 +0000
committerEric Wong <e@80x24.org>2022-09-30 16:25:07 +0000
commit0a8406bbb33f8ea1e432ce3e61796e389535642c (patch)
tree7200786145e49d551faaae869c9a81d13e995e1a /t/altid_v2.t
parentac62fcda86f4b79422299bb2dde8bee8c9e08c62 (diff)
downloadpublic-inbox-0a8406bbb33f8ea1e432ce3e61796e389535642c.tar.gz
Favor `is' for equality checks since it reports differences,
and `xbail' over `BAIL_OUT' since it's easier-to-type w/o caps
and more powerful.

These are just things noticed while I was looking at another
odd failure on CentOS 7.x with this test, but I suspect it
was a transient failure caused by running the test suite
from multiple terminals in parallel.
Diffstat (limited to 't/altid_v2.t')
-rw-r--r--t/altid_v2.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/altid_v2.t b/t/altid_v2.t
index 281a09d5..c62252c1 100644
--- a/t/altid_v2.t
+++ b/t/altid_v2.t
@@ -14,9 +14,9 @@ my $ibx = create_inbox 'v2', version => 2, indexlevel => 'medium',
                         altid => $altid, sub {
         my ($im, $ibx) = @_;
         my $mm = PublicInbox::Msgmap->new_file("$ibx->{inboxdir}/$another", 2);
-        $mm->mid_set(1234, 'a@example.com') == 1 or BAIL_OUT 'mid_set once';
-        ok(0 == $mm->mid_set(1234, 'a@example.com'), 'mid_set not idempotent');
-        ok(0 == $mm->mid_set(1, 'a@example.com'), 'mid_set fails with dup MID');
+        is($mm->mid_set(1234, 'a@example.com'), 1, 'mid_set') or xbail 'once';
+        is($mm->mid_set(1234, 'a@example.com')+0, 0, 'mid_set not idempotent');
+        is($mm->mid_set(1, 'a@example.com')+0, 0, 'mid_set fails with dup MID');
         $im->add(PublicInbox::Eml->new(<<'EOF')) or BAIL_OUT;
 From: a@example.com
 To: b@example.com
@@ -27,8 +27,8 @@ hello world gmane:666
 EOF
 };
 my $mm = PublicInbox::Msgmap->new_file("$ibx->{inboxdir}/$another", 2);
-ok(0 == $mm->mid_set(1234, 'a@example.com'), 'mid_set not idempotent');
-ok(0 ==  $mm->mid_set(1, 'a@example.com'), 'mid_set fails with dup MID');
+is($mm->mid_set(1234, 'a@example.com') + 0, 0, 'mid_set not idempotent');
+is($mm->mid_set(1, 'a@example.com') + 0, 0, 'mid_set fails with dup MID');
 my $mset = $ibx->search->mset('gmane:1234');
 my $msgs = $ibx->search->mset_to_smsg($ibx, $mset);
 $msgs = [ map { $_->{mid} } @$msgs ];