about summary refs log tree commit diff
path: root/t/2000-mpick.t
diff options
context:
space:
mode:
authorDuncan Overbruck <mail@duncano.de>2020-07-30 22:10:14 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-07-30 22:18:21 +0200
commitd9c3914924c0aa71bdbbe4a52a4f49f68bfbd679 (patch)
treee4ae3922dca1b41ad327eefeedab673871c5989a /t/2000-mpick.t
parent96c506085f13942a788104abd4edc7a4c10ea5a2 (diff)
downloadmblaze-d9c3914924c0aa71bdbbe4a52a4f49f68bfbd679.tar.gz
mblaze-d9c3914924c0aa71bdbbe4a52a4f49f68bfbd679.tar.xz
mblaze-d9c3914924c0aa71bdbbe4a52a4f49f68bfbd679.zip
mpick: breaking cmdline options
Two breaking changes which will make mpick fit more in with
all other mblaze tools by using mmsg(7) arguments:
- Use the -F flag to read script files.
- Remove msglist support
Diffstat (limited to 't/2000-mpick.t')
-rwxr-xr-xt/2000-mpick.t34
1 files changed, 17 insertions, 17 deletions
diff --git a/t/2000-mpick.t b/t/2000-mpick.t
index 2f530e8..27f784f 100755
--- a/t/2000-mpick.t
+++ b/t/2000-mpick.t
@@ -19,14 +19,14 @@ touch "inbox/cur/7:2,SR"
 touch "inbox/cur/8:2,SF"
 touch "inbox/cur/9:2,"
 
-check_same 'flag trashed' 'mlist inbox | mpick :T' 'mlist -T inbox'
-check_same 'flag not trashed' 'mlist inbox | mpick -t "!trashed"' 'mlist -t inbox'
-check_same 'flag seen' 'mlist inbox | mpick :S' 'mlist -S inbox'
+check_same 'flag trashed' 'mlist inbox | mpick -t trashed' 'mlist -T inbox'
+check_same 'flag not trashed' 'mlist inbox | mpick -t !trashed' 'mlist -t inbox'
+check_same 'flag seen' 'mlist inbox | mpick -t seen' 'mlist -S inbox'
 check_same 'flag not seen' 'mlist inbox | mpick -t !seen' 'mlist -s inbox'
-check_same 'flag seen and trashed' 'mlist inbox | mpick :S :T' 'mlist -ST inbox'
-check_same 'flag seen and not trashed' 'mlist inbox | mpick -t "seen && !trashed"' 'mlist -St inbox'
-check_same 'flag replied' 'mlist inbox | mpick :R' 'mlist -R inbox'
-check_same 'flag forwarded' 'mlist inbox | mpick :F' 'mlist -F inbox'
+check_same 'flag seen and trashed' 'mlist inbox | mpick -t seen -t trashed' 'mlist -ST inbox'
+check_same 'flag seen and not trashed' 'mlist inbox | mpick -t seen -t !trashed' 'mlist -St inbox'
+check_same 'flag replied' 'mlist inbox | mpick -t replied' 'mlist -R inbox'
+check_same 'flag forwarded' 'mlist inbox | mpick -t passed' 'mlist -P inbox'
 
 
 cat <<! | mmime >"inbox/cur/1:2,S"
@@ -62,14 +62,14 @@ Greetings
 !
 
 cat <<! >shebang
-#!$(command -v mpick)
+#!$(command -v mpick) -F
 from.addr == "peter@example.org" && from.disp == "Peter Example"
 !
 chmod +x shebang
 
-check 'search subject' 'mlist inbox | mpick /wow | grep -q inbox/cur/9:2,'
-check_test 'search addr' -eq 2 'mlist inbox | mpick peter@example.org | wc -l'
-check_test 'search name' -eq 2 'mlist inbox | mpick "Peter Example" | wc -l'
+check 'search subject' 'mlist inbox | mpick -t "subject =~~ \"wow\"" | grep -q inbox/cur/9:2,'
+check_test 'search addr' -eq 2 'mlist inbox | mpick -t "from.addr == \"peter@example.org\"" | wc -l'
+check_test 'search name' -eq 2 'mlist inbox | mpick -t "from.disp == \"Peter Example\"" | wc -l'
 check_test 'search spam' -eq 1 'mlist inbox | mpick -t "trashed && subject =~ \"pdf\"" | wc -l'
 check_test 'any header' -eq 1 'mlist inbox | mpick -t "\"Foo\" =~~ \"bar\"" | wc -l'
 check_test 'addr decode addr' -eq 2 'mlist inbox | mpick -t "from.addr == \"peter@example.org\"" | wc -l'
@@ -92,7 +92,7 @@ let bar = from.disp == "Peter Example"
 in
   foo && bar # another comment
 !
-check_test 'let expression' -eq 2 'mlist inbox | mpick ./expr | wc -l'
+check_test 'let expression' -eq 2 'mlist inbox | mpick -F ./expr | wc -l'
 
 cat <<! >expr
 let foo = from.addr == "peter@example.org"
@@ -101,7 +101,7 @@ let bar = from.disp == "Peter Example"
 in
   foo && foo
 !
-check_test 'let expression double free' -eq 2 'mlist inbox | mpick ./expr | wc -l'
+check_test 'let expression double free' -eq 2 'mlist inbox | mpick -F ./expr | wc -l'
 
 cat <<! >expr
 let foo =
@@ -111,7 +111,7 @@ let foo =
 in
   foo
 !
-check_test 'let expression nested' -eq 2 'mlist inbox | mpick ./expr | wc -l'
+check_test 'let expression nested' -eq 2 'mlist inbox | mpick -F ./expr | wc -l'
 
 cat <<! >expr
 let foo = from.addr == "peter@example.org"
@@ -119,7 +119,7 @@ let bar = foo && subject =~ "wow"
 in
   bar
 !
-check_test 'let scoping' -eq 1 'mlist inbox | mpick ./expr | wc -l'
+check_test 'let scoping' -eq 1 'mlist inbox | mpick -F ./expr | wc -l'
 
 cat <<! >expr
 let foo = from.addr == "peter@example.org"
@@ -127,8 +127,8 @@ let bar = from.disp == "Peter Example"
 in
   foo |"sed ""s/^/1:&/""" && bar |"sed ""s/^/2:&/""" && skip
 !
-check_test 'multi redir' -eq 4 'mlist inbox | mpick ./expr | wc -l'
-check_test 'multi redir prefixes' -eq 2 'mlist inbox | mpick ./expr | cut -d: -f1 | sort -u | wc -l'
+check_test 'multi redir' -eq 4 'mlist inbox | mpick -F ./expr | wc -l'
+check_test 'multi redir prefixes' -eq 2 'mlist inbox | mpick -F ./expr | cut -d: -f1 | sort -u | wc -l'
 
 )