diff options
| author | dana <dana@dana.is> | 2026-06-14 03:59:54 +0000 |
|---|---|---|
| committer | dana <dana@dana.is> | 2026-06-20 19:17:54 -0500 |
| commit | 6cf538a00f6dd9647b99854ea2335bb6d4db03e9 (patch) | |
| tree | bbc6780b9e88afce674e581eddc3a35006fcb975 /Test | |
| parent | 54763: _sh: support more shells + options (diff) | |
| download | zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar.gz zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar.bz2 zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar.lz zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar.xz zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.tar.zst zsh-6cf538a00f6dd9647b99854ea2335bb6d4db03e9.zip | |
54767: zformat: replace -qn by spec quoting indicator syntax
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/V13zformat.ztst | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/Test/V13zformat.ztst b/Test/V13zformat.ztst index 74fc14ae8..72c4229a1 100644 --- a/Test/V13zformat.ztst +++ b/Test/V13zformat.ztst @@ -275,35 +275,32 @@ zformat -qa reply . zformat -aq reply . -1:-a + -q not allowed -?(eval):zformat:1: -q not allowed with -a -?(eval):zformat:2: -q not allowed with -a + zformat -aQ reply . +1:-a + -qQ not allowed +?(eval):zformat:1: -qQ not allowed with -a +?(eval):zformat:2: -qQ not allowed with -a +?(eval):zformat:3: -qQ not allowed with -a zformat -Fq REPLY F && print -r - $REPLY zformat -qF REPLY F && print -r - $REPLY zformat -FqF REPLY F && print -r - $REPLY - zformat -q1 -F REPLY F && print -r - $REPLY - zformat -q1F REPLY F && print -r - $REPLY - zformat -q-1 -F REPLY F && print -r - $REPLY -1:optional argument to -q + zformat -qqF REPLY F && print -r - $REPLY + zformat -qQF REPLY F && print -r - $REPLY +1:more than one of -qQ not allowed >F >F >F >F -?(eval):zformat:5: bad argument to -q: 1F -?(eval):zformat:6: bad option: -- +?(eval):zformat:5: only one of -qQ allowed -# the spec order in the format string differs from the order in the arguments -# here to make sure we're testing -qn's effects on the latter - for 1 in '' 0 1 2 3; do - zformat -Fq$1 REPLY '%%x %) %. %X %D %d' d:%foo% D:%bar% && print -r - $REPLY + for 1 in -F -FQ -Fq; do + zformat $1 REPLY '%a, %b, %c, %d, %%e' a:%aaa% %b:%bbb% %%c:%ccc% + print -r - $REPLY done -0:-q with and without optarg ->%%x %) %. %X %%bar%% %%foo%% ->%%x %) %. %X %bar% %foo% ->%%x %) %. %X %bar% %%foo%% ->%%x %) %. %X %%bar%% %%foo%% ->%%x %) %. %X %%bar%% %%foo%% +0:spec quoting indicators, -Q vs -q +>%aaa%, %%bbb%%, %ccc%, %d, %e +>%%aaa%%, %%bbb%%, %ccc%, %d, %e +>%%aaa%%, %%bbb%%, %ccc%, %d, %%e zformat -Fq REPLY '%(x.%%/%d.%%/%D)' x:1 d:%foo% D:%bar% && print -r - $REPLY zformat -Fq REPLY '%(X.%%/%d.%%/%D)' x:1 d:%foo% D:%bar% && print -r - $REPLY @@ -340,11 +337,3 @@ 0:-q: ternary width test ignores extra %s >t f f >t t f - - zformat -FQ REPLY '%%x %) %. %X %D %d' d:%foo% D:%bar% && print -r - $REPLY - zformat -FQ0 REPLY '%%x %) %. %X %D %d' d:%foo% D:%bar% && print -r - $REPLY - zformat -FQ1 REPLY '%%x %) %. %X %D %d' d:%foo% D:%bar% && print -r - $REPLY -0:-Q, -Q0, -Q1 ->%x ) %. %X %%bar%% %%foo%% ->%x ) %. %X %bar% %foo% ->%x ) %. %X %bar% %%foo%% |
