-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# edit frontend behavior test (t/replace.t for backend)
use strict;
$ibx = PublicInbox::InboxWritable->new($ibx, {nproc=>1});
my $cfgfile = "$tmpdir/config";
local $ENV{PI_CONFIG} = $cfgfile;
-my $file = 't/data/0001.patch';
-open my $fh, '<', $file or die "open: $!";
-my $raw = do { local $/; <$fh> };
my $im = $ibx->importer(0);
-my $mime = PublicInbox::Eml->new($raw);
+my $file = 't/data/0001.patch';
+my $mime = eml_load($file);
my $mid = mid_clean($mime->header('Message-Id'));
ok($im->add($mime), 'add message to be edited');
$im->done;
ok(run_script($cmd, undef, $opt), "$t edit OK");
$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
- like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
+ like($out, qr/[a-f0-9]{40,}/, "$t shows commit on success");
}
$t = '-m MESSAGE_ID'; {
ok(run_script($cmd, undef, $opt), "$t edit OK");
$cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
like($cur->header('Subject'), qr/boolean prefix/, "$t message edited");
- like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
+ like($out, qr/[a-f0-9]{40,}/, "$t shows commit on success");
}
$t = 'no-op -m MESSAGE_ID'; {