diff options
author | Bart Schaefer <schaefer@ipost.com> | 2021-04-13 21:30:06 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@ipost.com> | 2021-04-13 21:30:06 -0700 |
commit | f85cb4504561df0b486e3e140d4c0434516a0f7f (patch) | |
tree | 076e1c7ff63c0b59573f5f993e50b63791b7f651 /Test/E03posix.ztst | |
parent | 0793ce4e61290d15ee7e53c15a2b8425e20c806c (diff) | |
parent | fefd3854b4abea8b46a2ad568762d3a710af77d9 (diff) | |
download | zsh-f85cb4504561df0b486e3e140d4c0434516a0f7f.tar.gz zsh-f85cb4504561df0b486e3e140d4c0434516a0f7f.tar.xz zsh-f85cb4504561df0b486e3e140d4c0434516a0f7f.zip |
Merge branch 'typesettounset' into declarednull declarednull
Adds 'setopt typeset_to_unset', documentation, failure tests for POSIX incompatibilies, etc.
Diffstat (limited to 'Test/E03posix.ztst')
-rw-r--r-- | Test/E03posix.ztst | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/Test/E03posix.ztst b/Test/E03posix.ztst index c59ca4f6e..7db4c0c84 100644 --- a/Test/E03posix.ztst +++ b/Test/E03posix.ztst @@ -4,7 +4,7 @@ # %prep - setopt POSIX_BUILTINS + setopt POSIX_BUILTINS TYPESET_TO_UNSET %test @@ -117,3 +117,47 @@ } 0:readonly with typeset -p >typeset -g -r var + +# Tests expected to fail + + echo - +0f:A single "-" for echo does not end the arguments +F:POSIX requires a solitary "-" to be a plain argument +>- + + ARGV0=sh $ZTST_testdir/../Src/zsh -c 'foreach() { true; }' +-f:"foreach" is not a reserved word + + ARGV0=sh $ZTST_testdir/../Src/zsh -c 'end() { true; } +-f:"end" is not a reserved word + + a='a:b:' ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=:; printf "<%s>\n" $a' +0f:IFS is a separator, not a delimiter +><a> +><b> + + a=$'\ra\r\rb' ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=:; printf "<%s>\n" $a' +0f:All whitespace characters are "IFS whitespace" +F:isspace('\r') is true so \r should behave like space, \t, \n +F:This may also need to apply to multibyte whitespace +><a> +><b> + + ARGV0=sh $ZTST_testdir/../Src/zsh -c 'IFS=2; printf "<%s>\n" $((11*11))' +0f:IFS applies to math results (numbers treated as strings) +><1> +><1> + + ARGV0=sh $ZTST_testdir/../Src/zsh -c 'inf=42; echo $((inf))' +0f:All identifiers are variable references in POSIX arithmetic +F:POSIX has neither math functions nor floating point +>42 + + ARGV0=sh $ZTST_testdir/../Src/zsh -c 'EUID=10; echo "$EUID"' +-f:EUID is not a special variable +>10 + + ARGV0=sh $ZTST_testdir/../Src/zsh -c "printf '<%10s>\n' St$'\M-C\M-)'phane" +0f:Width of %s is computed in bytes not characters +F:This is considered a bugfix in zsh +>< Stéphane> |