From 52f9edfb756676b471deac69e5d55df1933aa528 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Feb 2017 01:51:05 +0000 Subject: search: remove unnecessary abstractions and functionality This simplifies the code a bit and reduces the translation overhead for looking directly at data from tools shipped with Xapian. While we're at it, fix thread-all.t :) --- t/search.t | 9 +-------- t/thread-all.t | 5 +++-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/search.t b/t/search.t index 2e29b827..000a0385 100644 --- a/t/search.t +++ b/t/search.t @@ -70,15 +70,8 @@ sub filter_mids { is($found->mid, 'root@s', 'mid set correctly'); ok(int($found->thread_id) > 0, 'thread_id is an integer'); + my ($res, @res); my @exp = sort qw(root@s last@s); - my $res = $ro->query("path:hello_world"); - my @res = filter_mids($res); - is_deeply(\@res, \@exp, 'got expected results for path: match'); - - foreach my $p (qw(hello hello_ hello_world2 hello_world_)) { - $res = $ro->query("path:$p"); - is($res->{total}, 0, "path variant `$p' does not match"); - } $res = $ro->query('s:(Hello world)'); @res = filter_mids($res); diff --git a/t/thread-all.t b/t/thread-all.t index 8ccf4f8c..b1f9b47c 100644 --- a/t/thread-all.t +++ b/t/thread-all.t @@ -1,7 +1,7 @@ # Copyright (C) 2016 all contributors # License: AGPL-3.0+ # -# real-world testing of search threading +# real-world testing of search threading performance use strict; use warnings; use Test::More; @@ -16,7 +16,6 @@ plan skip_all => "$pi_dir not initialized for $0" if $@; require PublicInbox::View; require PublicInbox::SearchThread; -my $pfx = PublicInbox::Search::xpfx('thread'); my $opts = { limit => 1000000, asc => 1 }; my $t0 = clock_gettime(CLOCK_MONOTONIC); my $elapsed; @@ -35,4 +34,6 @@ PublicInbox::View::thread_results($msgs); $elapsed = clock_gettime(CLOCK_MONOTONIC) - $t0; diag "thread_results $elapsed"; +ok(1, 'test completed without crashing :)'); + done_testing(); -- cgit v1.2.3-24-ge0c7