about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-28 11:15:01 +0000
committerEric Wong <e@80x24.org>2021-10-28 19:17:12 +0000
commit2e15f8d28228d96485891d3bfd19e09a7ba776a1 (patch)
treea72f6fb1c3e823d88f25ebf3c350d86851d0baef /t
parent0de5ec392999835027db8512c6a0e00406fa4dce (diff)
downloadpublic-inbox-2e15f8d28228d96485891d3bfd19e09a7ba776a1.tar.gz
It's not much of a savings, right now, but maybe it can be in the
future.  I wanted to eliminate the "lei convert" one, too, but
convert needs to preserve keywords which isn't possible with the
generic fallback, so new tests were written for convert, instead.
Diffstat (limited to 't')
-rw-r--r--t/lei-convert.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/lei-convert.t b/t/lei-convert.t
index 0ea860c8..e1849ff7 100644
--- a/t/lei-convert.t
+++ b/t/lei-convert.t
@@ -115,5 +115,15 @@ test_lei({ tmpdir => $tmpdir }, sub {
         @bar = ();
         PublicInbox::MboxReader->mboxrd($fh, sub { push @bar, shift });
         is_deeply(\@bar, [ $qp_eml ], 'readed gzipped mboxrd');
+
+        # Status => Maildir flag => Status round trip
+        $lei_out =~ s/^Status: O/Status: RO/sm or xbail "`seen' Status";
+        $rdr = { 0 => \($in = $lei_out), %$lei_opt };
+        lei_ok([qw(convert -F mboxrd -o), "$d/md2"], undef, $rdr);
+        @md = glob("$d/md2/*/*");
+        is(scalar(@md), 1, 'one message');
+        like($md[0], qr/:2,S\z/, "`seen' flag set in Maildir");
+        lei_ok(qw(convert -o mboxrd:/dev/stdout), "$d/md2");
+        like($lei_out, qr/^Status: RO/sm, "`seen' flag preserved");
 });
 done_testing;