-# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use Test::More;
use PublicInbox::MID qw(mid_escape mids references);
$mime->header_set('In-Reply-To', '<weld>');
is_deeply(['hello', 'world', 'weld'], references($mime->header_obj),
'references combines with In-Reply-To');
+
+ $mime->header_set('References', "<hello>\n\t<world>");
+ $mime->header_set('In-Reply-To');
+ is_deeply(references($mime->header_obj), ['hello', 'world'],
+ 'multiline References OK');
+ $mime->header_set('References', "<hello\tworld>");
+ is_deeply(references($mime->header_obj), ['helloworld'],
+ 'drop \t in References <656C30A1EFC89F6B2082D9B6@localhost>');
+ $mime->header_set('Message-ID', "<hello\tworld>");
+ is_deeply(mids($mime->header_obj), ['helloworld'],
+ 'drop \t in Message-ID');
+
+ $mime->header_set('To', 'u@example.com');
+ $mime->header_set('References', '<hello> <world> <n> <u@example.com>');
+ is_deeply(references($mime->header_obj), [qw(hello world)]);
}
done_testing();