Eric Wong <[email protected]> wrote:
> +++ b/t/lei-convert.t

> +test_lei({ tmpdir => $tmpdir }, sub {
> +     my $dig = Digest::SHA->new(256);
> +     lei_ok('convert', '-o', "mboxrd:$tmpdir/foo.mboxrd",
> +             "imap://$host_port/t.v2.0");
> +     ok(-f "$tmpdir/foo.mboxrd", 'mboxrd created');
> +     $dig->addfile("$tmpdir/foo.mboxrd");
> +     my $foo = $dig->digest;
> +     lei_ok('convert', '-o', "$tmpdir/md", "mboxrd:$tmpdir/foo.mboxrd");
> +     ok(-d "$tmpdir/md", 'Maildir created');
> +     lei_ok('convert', '-o', "mboxrd:$tmpdir/bar.mboxrd", "$tmpdir/md");
> +     $dig->addfile("$tmpdir/bar.mboxrd");
> +     my $bar = $dig->digest;
> +     is($foo, $bar, 'mboxrd round-tripped through Maildir');

Oh dear, I've truly lost my mind :<  readdir order is totally random
and by some dumb luck this worked when I tested it.

> +     open my $in, '<', "$tmpdir/bar.mboxrd" or BAIL_OUT;
> +     my $rdr = { 0 => $in, 1 => \(my $out), 2 => \$lei_err };
> +     lei_ok([qw(convert --stdin -F mboxrd -o mboxrd:/dev/stdout)],
> +             undef, $rdr);
> +     $dig->add($out);
> +     is($foo, $dig->digest, 'mboxrd round-tripped --stdin => stdout');
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to