]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/v[12]reindex.t: Place expected second in Xapian tests
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 1 Aug 2018 16:43:35 +0000 (11:43 -0500)
committerEric Wong <e@80x24.org>
Thu, 2 Aug 2018 02:18:11 +0000 (02:18 +0000)
Place the expected value second in is and isnt tests because when
these tests fail they report the second value as the expected value.

A report saying got 0 expected 8 'no Xapian search results' can be confusing.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
t/v1reindex.t
t/v2reindex.t

index fdffdaeee892abf03d830dbcea887230ca7320ea..de4fafda5ae953bdd453e55eaf4b4b2c9d236fcf 100644 (file)
@@ -144,7 +144,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
        my $mset = $ibx->search->query('hello world', {mset=>1});
-       isnt(0, $mset->size, 'got Xapian search results');
+       isnt($mset->size, 0, 'got Xapian search results');
 }
 
 ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
@@ -166,7 +166,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
        my $mset = $ibx->search->reopen->query('hello world', {mset=>1});
-       is(0, $mset->size, "no Xapian search results");
+       is($mset->size, 0, "no Xapian search results");
 }
 
 # upgrade existing basic to medium
@@ -184,7 +184,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is($@, '', 'no error from indexing');
        is_deeply(\@warn, [], 'no warnings');
        my $mset = $ibx->search->reopen->query('hello world', {mset=>1});
-       isnt(0, $mset->size, 'search OK after basic -> medium');
+       isnt($mset->size, 0, 'search OK after basic -> medium');
 }
 
 done_testing();
index 4d06c6ce6ea60078688a031683611c297eddec75..67d8be787a782c084ac42e763a4a5f98378214af 100644 (file)
@@ -119,7 +119,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
        my $mset = $ibx->search->query('"hello world"', {mset=>1});
-       isnt(0, $mset->size, "phrase search succeeds on indexlevel=full");
+       isnt($mset->size, 0, "phrase search succeeds on indexlevel=full");
        for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ }
 }
 
@@ -146,11 +146,11 @@ ok(!-d $xap, 'Xapian directories removed again');
                # phrase searches still work
                delete $ibx->{search};
                my $mset = $ibx->search->query('"hello world"', {mset=>1});
-               is(0, $mset->size, 'phrase search does not work on medium');
+               is($mset->size, 0, 'phrase search does not work on medium');
        }
 
        my $mset = $ibx->search->query('hello world', {mset=>1});
-       isnt(0, $mset->size, "normal search works on indexlevel=medium");
+       isnt($mset->size, 0, "normal search works on indexlevel=medium");
        for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ }
        ok($sizes{full} > $sizes{medium}, 'medium is smaller than full');
 }
@@ -173,7 +173,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
        my $mset = $ibx->search->query('hello', {mset=>1});
-       is(0, $mset->size, "search fails on indexlevel='basic'");
+       is($mset->size, 0, "search fails on indexlevel='basic'");
        for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ }
        ok($sizes{medium} > $sizes{basic}, 'basic is smaller than medium');
 }