]> Sergey Matveev's repositories - public-inbox.git/blob - t/nulsubject.t
examples/unsubscribe.milter: RFC 8058 (List-Unsubscribe=One-Click)
[public-inbox.git] / t / nulsubject.t
1 # Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 use strict;
4 use warnings;
5 use Test::More;
6 use PublicInbox::TestCommon;
7
8 use_ok 'PublicInbox::Import';
9 use_ok 'PublicInbox::Git';
10 my ($tmpdir, $for_destroy) = tmpdir();
11 my $git_dir = "$tmpdir/a.git";
12
13 {
14         my $git = PublicInbox::Git->new($git_dir);
15         my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
16         $im->init_bare;
17         $im->add(PublicInbox::Eml->new(<<'EOF'));
18 From: a@example.com
19 To: b@example.com
20 Subject: A subject line with a null =?iso-8859-1?q?=00?= see!
21 Message-ID: <null-test.a@example.com>
22
23 hello world
24 EOF
25         $im->done;
26         is(xsys(qw(git --git-dir), $git_dir, 'fsck', '--strict'), 0,
27                 'git fsck ok');
28 }
29
30 done_testing();
31
32 1;