From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6315 166.70.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4E2CD208EE; Wed, 1 Aug 2018 16:45:44 +0000 (UTC) Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fkuFr-0007uZ-NQ; Wed, 01 Aug 2018 10:45:43 -0600 Received: from [97.119.167.31] (helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.87) (envelope-from ) id 1fkuFr-0001mm-4g; Wed, 01 Aug 2018 10:45:43 -0600 From: "Eric W. Biederman" To: Eric Wong Cc: meta@public-inbox.org, "Eric W. Biederman" Date: Wed, 1 Aug 2018 11:43:35 -0500 Message-Id: <20180801164344.7911-4-ebiederm@xmission.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <878t5qkpis.fsf@xmission.com> References: <878t5qkpis.fsf@xmission.com> X-XM-SPF: eid=1fkuFr-0001mm-4g;;;mid=<20180801164344.7911-4-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18VxJvu7TYynyQjC/OT+e5MxEuiNZDegTM= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 04/13] t/v[12]reindex.t: Place expected second in Xapian tests X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) List-Id: 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" --- t/v1reindex.t | 6 +++--- t/v2reindex.t | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/t/v1reindex.t b/t/v1reindex.t index fdffdaeee892..de4fafda5ae9 100644 --- a/t/v1reindex.t +++ b/t/v1reindex.t @@ -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(); diff --git a/t/v2reindex.t b/t/v2reindex.t index 4d06c6ce6ea6..67d8be787a78 100644 --- a/t/v2reindex.t +++ b/t/v2reindex.t @@ -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'); } -- 2.17.1