about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/extsearch.t20
-rw-r--r--t/over.t2
2 files changed, 21 insertions, 1 deletions
diff --git a/t/extsearch.t b/t/extsearch.t
index f9f74e5c..f5855558 100644
--- a/t/extsearch.t
+++ b/t/extsearch.t
@@ -118,6 +118,26 @@ my $es = PublicInbox::ExtSearch->new("$home/extindex");
         is(scalar(@$x1), 1, 'original only has one xref3');
         is(scalar(@$x2), 1, 'new message has one xref3');
         isnt($x1->[0], $x2->[0], 'xref3 differs');
+
+        my $mset = $es->mset('b:"BEST MSG"');
+        is($mset->size, 1, 'new message found');
+        $mset = $es->mset('b:"test message"');
+        is($mset->size, 1, 'old message found');
+
+        delete @$es{qw(git over xdb)}; # fork preparation
+
+        open my $rmfh, '+>', undef or BAIL_OUT $!;
+        $rmfh->autoflush(1);
+        print $rmfh $eml2->as_string or BAIL_OUT $!;
+        seek($rmfh, 0, SEEK_SET) or BAIL_OUT $!;
+        $opt->{0} = $rmfh;
+        ok(run_script([qw(-learn rm --all)], undef, $opt), '-learn rm');
+
+        ok(run_script([qw(-extindex --all), "$home/extindex"], undef, undef),
+                'extindex after rm');
+        is($es->over->get_art(2), undef, 'doc #2 gone');
+        $mset = $es->mset('b:"BEST MSG"');
+        is($mset->size, 0, 'new message gone');
 }
 
 my $misc = $es->misc;
diff --git a/t/over.t b/t/over.t
index 56c20d01..22061249 100644
--- a/t/over.t
+++ b/t/over.t
@@ -91,7 +91,7 @@ $over->eidx_prep;
                         'xref3 works forw two');
 
         @arg = qw(1349 adeadba7cafe example.key);
-        ok($over->remove_xref3(@arg), 'remove first');
+        is($over->remove_xref3(@arg), 1, 'remove first');
         $xref3 = $over->get_xref3(1349);
         is_deeply($xref3, [ 'example.kee:2018:deadbeefcafe' ],
                 'confirm removal successful');