1 # Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use File::Temp qw/tempdir/;
8 use_ok 'PublicInbox::Import';
9 use_ok 'PublicInbox::Git';
10 my $tmpdir = tempdir('pi-nulsubject-XXXXXX', TMPDIR => 1, CLEANUP => 1);
11 my $git_dir = "$tmpdir/a.git";
14 is(system(qw(git init -q --bare), $git_dir), 0, 'git init ok');
15 my $git = PublicInbox::Git->new($git_dir);
16 my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
17 $im->add(Email::MIME->create(
19 From => 'a@example.com',
20 To => 'b@example.com',
21 'Content-Type' => 'text/plain',
22 Subject => ' A subject line with a null =?iso-8859-1?q?=00?= see!',
23 'Message-ID' => '<null-test.a@example.com>',
25 body => "hello world\n",
28 is(system(qw(git --git-dir), $git_dir, 'fsck', '--strict'), 0, 'git fsck ok');