1 # Copyright (C) 2017 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use_ok 'PublicInbox::Hval';
9 -no_obfuscate_re => qr/(?:example\.com)\z/i,
11 'meta@public-inbox.org' => 1,
23 PublicInbox::Hval::obfuscate_addrs($ibx, $html);
26 hello@example•comm
29 test@public-inbox•org
33 is($html, $exp, 'only obfuscated relevant addresses');
35 is('foo-bar', PublicInbox::Hval::to_filename('foo bar '),
36 'to_filename has no trailing -');
38 is('foo-bar', PublicInbox::Hval::to_filename("foo bar\nanother line\n"),
39 'to_filename has no repeated -, and nothing past LF');
41 is('foo.bar', PublicInbox::Hval::to_filename("foo....bar"),
42 'to_filename squeezes -');