From 6bc735051d38c1f84acaa40d8e724398e50dcc90 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 16 Mar 2020 15:33:39 +0000 Subject: indices can now return confidence levels also, tests pass again --- t/store.t | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 't/store.t') diff --git a/t/store.t b/t/store.t index bb519b1..b29556c 100644 --- a/t/store.t +++ b/t/store.t @@ -29,8 +29,24 @@ subtest 'indexing' => { subtest 'finding' => { my Channel $file-channel .= new; - my TestIndex $index1 .= new(:responses('1',Str,'1',Str),:name('index1')); - my TestIndex $index2 .= new(:responses('2',Str,Str,Str),:name('index2')); + my TestIndex $index1 .= new( + :responses( + Mailbox.new(:name('1'),:1confidence), + Mailbox, + Mailbox.new(:name('1'),:confidence(0.5)), + Mailbox + ), + :name('index1') + ); + my TestIndex $index2 .= new( + :responses( + Mailbox.new(:name('2'),:confidence(0.5)), + Mailbox, + Mailbox.new(:name('2'),:1confidence), + Mailbox + ), + :name('index2') + ); my MaildirIndexer::Store $store .= new( :$file-channel, @@ -43,8 +59,8 @@ subtest 'finding' => { is-deeply( @responses, - $['1','2','1',Str], - 'indexes are consulted until a defined value', + $['1',Str,'2',Str], + 'indexes are consulted, undefs ignored, highest confidence wins', ); } -- cgit v1.2.3