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.
---
t/altid_v2.t | 10 +++++-----
1 file 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, '[email protected]') == 1 or BAIL_OUT 'mid_set once';
- ok(0 == $mm->mid_set(1234, '[email protected]'), 'mid_set not
idempotent');
- ok(0 == $mm->mid_set(1, '[email protected]'), 'mid_set fails with dup
MID');
+ is($mm->mid_set(1234, '[email protected]'), 1, 'mid_set') or xbail
'once';
+ is($mm->mid_set(1234, '[email protected]')+0, 0, 'mid_set not
idempotent');
+ is($mm->mid_set(1, '[email protected]')+0, 0, 'mid_set fails with dup
MID');
$im->add(PublicInbox::Eml->new(<<'EOF')) or BAIL_OUT;
From: [email protected]
To: [email protected]
@@ -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, '[email protected]'), 'mid_set not idempotent');
-ok(0 == $mm->mid_set(1, '[email protected]'), 'mid_set fails with dup MID');
+is($mm->mid_set(1234, '[email protected]') + 0, 0, 'mid_set not idempotent');
+is($mm->mid_set(1, '[email protected]') + 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 ];