diff options
author | Eric Wong <e@80x24.org> | 2021-04-18 08:40:14 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-18 19:04:42 -0400 |
commit | 2018db2a23ab1d949c757c264534f39dba338ccb (patch) | |
tree | 86a06bda17018b97d760d579aa7214f68e1ab42e /t | |
parent | 3b7b5442c4321ae802867cbda9bd33235ab2a5a3 (diff) | |
download | public-inbox-2018db2a23ab1d949c757c264534f39dba338ccb.tar.gz |
Going forward, we'll probably support JSON for all the "ls-*" subcommands. This also provides the basis for "lei up" shell completion.
Diffstat (limited to 't')
-rw-r--r-- | t/lei-q-save.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/lei-q-save.t b/t/lei-q-save.t index a8eda41e..761814b4 100644 --- a/t/lei-q-save.t +++ b/t/lei-q-save.t @@ -55,5 +55,17 @@ test_lei(sub { ok(-s "$home/mbcl2" > $size, 'size increased after up'); ok(!lei(qw(up -q), $home), 'up fails w/o --save'); + + lei_ok qw(ls-search); my @d = split(/\n/, $lei_out); + lei_ok qw(ls-search -z); my @z = split(/\0/, $lei_out); + is_deeply(\@d, \@z, '-z output matches non-z'); + is_deeply(\@d, [ "$home/mbcl2", "$home/md/" ], + 'ls-search output alphabetically sorted'); + lei_ok qw(ls-search -l); + my $json = PublicInbox::Config->json->decode($lei_out); + ok($json && $json->[0]->{output}, 'JSON has output'); + lei_ok qw(_complete lei up); + like($lei_out, qr!^\Q$home/mbcl2\E$!sm, 'complete got mbcl2 output'); + like($lei_out, qr!^\Q$home/md/\E$!sm, 'complete got maildir output'); }); done_testing; |