summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2019-12-27 14:14:24 +0000
committerdakkar <dakkar@thenautilus.net>2019-12-27 15:15:36 +0000
commitd31b7f8710f89db6035a80adae4d97ada8503336 (patch)
treeab8d718f71075e49d2cad5ee9edaac63bd53973a /t
parentrestructure store, extract server (diff)
downloadMaildirIndexer-d31b7f8710f89db6035a80adae4d97ada8503336.tar.gz
MaildirIndexer-d31b7f8710f89db6035a80adae4d97ada8503336.tar.bz2
MaildirIndexer-d31b7f8710f89db6035a80adae4d97ada8503336.zip
extract addresses
tried to add some typing, wanted to return `Positional[Str:D]`, but half the `Array` / `List` methods return `Seq`, empty arrays are untyped, plus https://github.com/rakudo/rakudo/issues/3383 made the whole thing a mess so we're just returning `Iterable`, which is not even parametric, so we can't promise we're returning strings
Diffstat (limited to 't')
-rw-r--r--t/email.t12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/email.t b/t/email.t
index f2208a6..c6093db 100644
--- a/t/email.t
+++ b/t/email.t
@@ -10,7 +10,8 @@ subtest 'no values' => {
);
is-deeply $email.message-id, '', 'message id should parse';
- is-deeply $email.refs, qw[], 'refs should parse';
+ is-deeply $email.refs, @(), 'refs should parse';
+ is-deeply $email.addresses, @(), 'addresses should parse';
}
subtest 'bad values' => {
@@ -24,7 +25,8 @@ subtest 'bad values' => {
);
is-deeply $email.message-id, '', 'message id should parse';
- is-deeply $email.refs, qw[], 'refs should parse';
+ is-deeply $email.refs, @(), 'refs should parse';
+ is-deeply $email.addresses, @(), 'addresses should parse';
}
subtest 'all values' => {
@@ -33,12 +35,18 @@ subtest 'all values' => {
message-id => 'some <stuff> here',
in-reply-to => '<one>',
references => 'bad <two> garbage <three>',
+ reply-to => 'foo <one@me>',
+ from => 'me@my.domain',
+ to => 'one <one@your.domain>, two <two@their.domain>, etc',
),
body => '',
);
is-deeply $email.message-id, 'stuff', 'message id should parse';
is-deeply $email.refs, qw[one three two], 'refs should parse';
+ is-deeply( $email.addresses.sort,
+ @('me@my.domain','one@me','one@your.domain','two@their.domain'),
+ 'addresses should parse' );
}
done-testing;