diff options
author | Eric Wong <e@80x24.org> | 2021-03-20 19:04:06 +0900 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-21 09:45:49 +0000 |
commit | bd287d742b81dab13e936727724e5c4de55c44c7 (patch) | |
tree | 58062cfdcabe51ffba180a991f2acd5839ecca27 /t/lei-q-kw.t | |
parent | bcf5a733206b14f82cc151c702fd554cd08481ff (diff) | |
download | public-inbox-bd287d742b81dab13e936727724e5c4de55c44c7.tar.gz |
These changes may make it easier to do byte-for-byte comparisons with mail copied out of mutt, a popular MUA for our target audience. mutt currently outputs the 'R' (seen) flag before the 'O' character in the Status: header. We'll assume that stays the case (it has been for a while). Status now comes before X-Status, also matching mutt behavior.
Diffstat (limited to 't/lei-q-kw.t')
-rw-r--r-- | t/lei-q-kw.t | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/t/lei-q-kw.t b/t/lei-q-kw.t index de2c775a..b5e22e9b 100644 --- a/t/lei-q-kw.t +++ b/t/lei-q-kw.t @@ -13,7 +13,7 @@ my $exp = { '<qp@example.com>' => eml_load('t/plack-qp.eml'), '<testmessage@example.com>' => eml_load('t/utf8.eml'), }; -$exp->{'<qp@example.com>'}->header_set('Status', 'OR'); +$exp->{'<qp@example.com>'}->header_set('Status', 'RO'); $exp->{'<testmessage@example.com>'}->header_set('Status', 'O'); test_lei(sub { @@ -57,7 +57,7 @@ SKIP: { open my $fh, '<', \$buf or BAIL_OUT $!; PublicInbox::MboxReader->mboxrd($fh, sub { my ($eml) = @_; - $eml->header_set('Status', 'OR'); + $eml->header_set('Status', 'RO'); is_deeply($eml, $exp->{'<qp@example.com>'}, 'FIFO output works as expected'); }); @@ -96,7 +96,7 @@ for my $sfx ('', '.gz') { is($buf, '', 'emptied'); lei_ok(qw(q -o), "mboxrd:$o", qw(m:qp@example.com)); $buf = $read_file->($o); - $buf =~ s/\nStatus: O\n\n/\nStatus: OR\n\n/s or + $buf =~ s/\nStatus: O\n\n/\nStatus: RO\n\n/s or BAIL_OUT "no Status in $buf"; $write_file->($o, $buf); lei_ok(qw(q -a -o), "mboxrd:$o", qw(m:testmessage@example.com)); @@ -111,7 +111,7 @@ for my $sfx ('', '.gz') { lei_ok(qw(q -o), "mboxrd:/dev/stdout", qw(m:qp@example.com)) or diag $lei_err; - like($lei_out, qr/^Status: OR\n/sm, 'Status set by previous augment'); + like($lei_out, qr/^Status: RO\n/sm, 'Status set by previous augment'); } # /mbox + mbox.gz tests my ($ro_home, $cfg_path) = setup_public_inboxes; @@ -144,7 +144,7 @@ lei_ok(qw(q -o), "mboxrd:$o", "m:$m", @inc); # emulate MUA marking mboxrd message as unread open my $fh, '<', $o or BAIL_OUT; my $s = do { local $/; <$fh> }; -$s =~ s/^Status: OR\n/Status: O\nX-Status: AF\n/sm or +$s =~ s/^Status: RO\n/Status: O\nX-Status: AF\n/sm or fail "failed to clear R flag in $s"; open $fh, '>', $o or BAIL_OUT; print $fh $s or BAIL_OUT; @@ -155,8 +155,8 @@ lei_ok(qw(q -o), "mboxrd:$o", 'm:bogus', @inc, lei_ok(qw(q -o), "mboxrd:$o", "m:$m", @inc); open $fh, '<', $o or BAIL_OUT; $s = do { local $/; <$fh> }; -like($s, qr/^Status: O\n/ms, 'seen keyword gone in mbox'); -like($s, qr/^X-Status: AF\n/ms, 'answered + flagged set'); +like($s, qr/^Status: O\nX-Status: AF\n/ms, + 'seen keyword gone in mbox, answered + flagged set'); lei_ok(qw(q --pretty), "m:$m", @inc); like($lei_out, qr/^ "kw": \["answered", "flagged"\],\n/sm, |