Increase randomness of HitQueue test. Insert docs into HitQueue in random order to stress the heap sort, even though they will be inserted in doc_id order in current Lucy.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3b1945e0 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3b1945e0 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3b1945e0 Branch: refs/heads/master Commit: 3b1945e02031116de2d4cebdc6fa67ef2f0aaa59 Parents: 6ea4ea2 Author: Marvin Humphrey <[email protected]> Authored: Tue Jul 22 00:58:29 2014 +0000 Committer: Marvin Humphrey <[email protected]> Committed: Tue Jul 22 00:58:29 2014 +0000 ---------------------------------------------------------------------- perl/t/505-hit_queue.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/3b1945e0/perl/t/505-hit_queue.t ---------------------------------------------------------------------- diff --git a/perl/t/505-hit_queue.t b/perl/t/505-hit_queue.t index 002a749..31acaa7 100644 --- a/perl/t/505-hit_queue.t +++ b/perl/t/505-hit_queue.t @@ -36,7 +36,7 @@ my @match_docs = map { doc_id => $_->[0], score => $_->[1], ) -} @docs_and_scores; +} shuffle(@docs_and_scores); my @correct_order = sort { $b->get_score <=> $a->get_score @@ -196,7 +196,7 @@ for ( 1 .. 30 ) { doc_id => $_->[0], score => $_->[1], ) -} sort { $a->[0] <=> $b->[0] } @docs_and_scores; +} shuffle(@docs_and_scores); for my $size ( 0 .. $#match_docs ) { $hit_q = Lucy::Search::HitQueue->new( wanted => $size, );
