summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2019-05-07 23:24:49 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2019-05-07 23:24:49 +0200
commitcd6fd2b0a3641774e7854ff8298d1d82643c4b4a (patch)
tree1b09fbc0dfed078e48c945352c6635a4a6bcbb04 /Test
parent5200637bda09e34da934e18f3c30f4b124d8d597 (diff)
downloadzsh-cd6fd2b0a3641774e7854ff8298d1d82643c4b4a.tar.gz
zsh-cd6fd2b0a3641774e7854ff8298d1d82643c4b4a.tar.xz
zsh-cd6fd2b0a3641774e7854ff8298d1d82643c4b4a.zip
44274: allow finer control of completion match soring with compadd's -o option
Diffstat (limited to 'Test')
-rw-r--r--Test/Y01completion.ztst40
1 files changed, 40 insertions, 0 deletions
diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index f1c981f26..ff266306f 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -138,6 +138,46 @@ F:regression test workers/31611
 >FI:{\|foo}
 >FI:{\~foo}
 
+  comptesteval "_tst() { compadd -onum,rev -J versions r1.10 r1.1 r1.2 r2.3 r2.34 }"
+  comptest $'tst r\t'
+0:reverse numeric sorting of matches
+>line: {tst r}{}
+>NO:{r2.34}
+>NO:{r2.3}
+>NO:{r1.10}
+>NO:{r1.2}
+>NO:{r1.1}
+
+  comptesteval "_tst() { local expl; _wanted times expl time compadd -o match r1.10 r1.2 r2.3 r2.34 }"
+  comptesteval "zstyle ':completion:*:tst:*' sort reverse numeric"
+  comptest $'tst r\t'
+0:reverse numeric sorting of matches via a style
+>line: {tst r}{}
+>DESCRIPTION:{time}
+>NO:{r2.34}
+>NO:{r2.3}
+>NO:{r1.10}
+>NO:{r1.2}
+
+  comptesteval "_tst() { local disp=(a b c); compadd -o -J letters -d disp 3 2 1 }"
+  comptest $'tst \t'
+0:sort in match rather than display name order
+>line: {tst }{}
+>NO:{c}
+>NO:{b}
+>NO:{a}
+
+  comptesteval "_tst() { local expl; _wanted times expl time compadd 3am 12pm 3pm 10pm }"
+  comptesteval "zstyle ':completion:*:tst:*' sort false"
+  comptest $'tst \t'
+0:sorting disabled via the sort style
+>line: {tst }{}
+>DESCRIPTION:{time}
+>NO:{3am}
+>NO:{12pm}
+>NO:{3pm}
+>NO:{10pm}
+
 %clean
 
   zmodload -ui zsh/zpty