summaryrefslogtreecommitdiff
path: root/t/lib/TestIndex.pm6
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2019-12-29 13:24:00 +0000
committerdakkar <dakkar@thenautilus.net>2019-12-29 13:45:21 +0000
commit5b10920b6e38614ceea0cd97031ab48f4f1f9a39 (patch)
tree031a9a787823b6a2913824235a77f86f76a94d88 /t/lib/TestIndex.pm6
parentit's called `raku` now (diff)
downloadMaildirIndexer-5b10920b6e38614ceea0cd97031ab48f4f1f9a39.tar.gz
MaildirIndexer-5b10920b6e38614ceea0cd97031ab48f4f1f9a39.tar.bz2
MaildirIndexer-5b10920b6e38614ceea0cd97031ab48f4f1f9a39.zip
new module extension
Diffstat (limited to 't/lib/TestIndex.pm6')
-rw-r--r--t/lib/TestIndex.pm635
1 files changed, 0 insertions, 35 deletions
diff --git a/t/lib/TestIndex.pm6 b/t/lib/TestIndex.pm6
deleted file mode 100644
index c0b0b03..0000000
--- a/t/lib/TestIndex.pm6
+++ /dev/null
@@ -1,35 +0,0 @@
-use v6.d;
-use MaildirIndexer::Index;
-
-unit class TestIndex does MaildirIndexer::Index;
-
-has %.mails;
-has $.name = 'test index';
-has @.responses = ( 'foo' xx 10 );
-
-has atomicint $!seen = 0;
-has Int $.expect;
-has $.seen-all;
-has $!seen-all-vow;
-
-method set-expect(Int:D $!expect) {
- $!seen ⚛= 0;
- $!seen-all = Promise.new;
- $!seen-all-vow = $!seen-all.vow;
-}
-
-method add-mail(MaildirIndexer::Email:D $email, Str:D $mailbox --> Nil) {
- %.mails{$mailbox}{$email.path}=1;
- ++⚛$!seen;
- if ($!seen == $!expect) {
- $!seen-all-vow.keep(True)
- }
-}
-
-method del-path(IO:D $path, Str:D $mailbox --> Nil) {
- %.mails{$mailbox}{$path}:delete;
-}
-
-method mailbox-for-email(MaildirIndexer::Email:D $email --> Str) {
- return @!responses.shift;
-}