diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | Test/D03procsubst.ztst | 20 | ||||
-rw-r--r-- | Test/D07multibyte.ztst | 11 | ||||
-rw-r--r-- | Test/E01options.ztst | 6 | ||||
-rw-r--r-- | Test/V14system.ztst | 66 |
5 files changed, 112 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 7de1a877a..5648c3cd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2022-05-01 Bart Schaefer <schaefer@zsh.org> + + * 50160: Test/D03procsubst.ztst, Test/E01options.ztst: Regression + tests for 50126, 50136, and 50149 + + * 50159: Test/V14system.ztst: Tests for sysread + + * 50157 (Daniel Shahaf): Test/D07multibyte.ztst: Test for 50150 + 2022-05-01 dana <dana@dana.is> * unposted: Config/version.mk: Update for 5.8.1.3-test (5.9) diff --git a/Test/D03procsubst.ztst b/Test/D03procsubst.ztst index 1e5cd9f6c..d68db35fa 100644 --- a/Test/D03procsubst.ztst +++ b/Test/D03procsubst.ztst @@ -167,5 +167,25 @@ print -rC1 -- $TMPPREFIX*(N) } 0f:external command with =(...) on LHS of pipeline cleans up its tempfiles +F:subshells including pipe LHS do not pass through zexit() # (Expected result: no output.) +# Confirm tempfile exists in the function, but not after exit + () { + local -x TMPPREFIX=$PWD/exit + $ZTST_testdir/../Src/zsh -fc ' + () { + print -rC1 -- $TMPPREFIX* + exit + } =(sleep 5) + ' + print -rC1 -- $TMPPREFIX*(N) + } +0:regression test: exit in shell function cleans up tempfiles +F:see preceding test +*>*.tmp/exit* + + print -u $ZTST_fd 'This test hangs the shell when it fails...' + true | false =(nosuchcommand$$) +1:regression test: race condition with pipe and procsubst +*?\(eval\):2: command not found: nosuchcommand* diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst index cbd802f23..25634e502 100644 --- a/Test/D07multibyte.ztst +++ b/Test/D07multibyte.ztst @@ -627,3 +627,14 @@ F:support character sets outside the portable 7-bit range. 0:locale gets restored when locale parameters go out of scope (regression test for 45772) >❯ >❯ + + # Subshell for zmodload isolation + ( + zmodload zsh/stat + touch 50150-é 50150-Ą + # Using +size solely in order to make it easier to write the expectations + zstat +size -nor -- 50150-* + ) +0:(workers/50150) zsh/stat with Unicode and metafication +>50150-Ą 0 +>50150-é 0 diff --git a/Test/E01options.ztst b/Test/E01options.ztst index 72749e6ab..b57b23557 100644 --- a/Test/E01options.ztst +++ b/Test/E01options.ztst @@ -752,6 +752,12 @@ >These are the contents of the file >These are the contents of the file +# Subshell to shield nullexec redirections + ( exec 3>&1 3>&2; print -u 3 some words ) +0:regression test: multios with nullexec +>some words +?some words + # tried this with other things, but not on its own, so much. unsetopt nomatch print with nonomatch: flooble* diff --git a/Test/V14system.ztst b/Test/V14system.ztst index ffdb730a4..81253324f 100644 --- a/Test/V14system.ztst +++ b/Test/V14system.ztst @@ -147,3 +147,69 @@ F:This timing test might fail due to process scheduling issues unrelated to zsh. 0:zsystem flock successful wait test, fractional seconds ?elapsed time seems OK F:This timing test might fail due to process scheduling issues unrelated to zsh. + + unset chars REPLY + print -n a few words | sysread -i 0 -c chars + ret=$? + print -- $chars x${REPLY}x + return ret +0:sysread default +>11 xa few wordsx + + unset chars REPLY + sysread -i 9 -c chars + ret=$? + print -- $chars x${REPLY}x + return ret +2:sysread read error +>-1 xx + + REPLY="say nothing" + sysread -i 9 -c chars + ret=$? + print -- $chars x${REPLY}x + return ret +2f:sysread read error +F:The value of $REPLY should be empty or unset when nothing is read? +>-1 xx + + unset chars REPLY + print -n a few words | sysread -i 0 -o 9 -c chars + ret=$? + print -- $chars x${REPLY}x + return ret +3:sysread write error +>11 xx + + sleep 3 | sysread -i 0 -t 1 +4:sysread timeout + + sysread -i 0 </dev/null +5:sysread end of file + + unset chars oration + print -n a few words | sysread -i 0 -o 9 -c chars oration + ret=$? + print $chars x${oration}x $REPLY + return ret +3:regression test: sysread write error with both -o and a parameter +>11 xa few wordsx + + unset chars oration + print a few words | sysread -i 0 -o 1 -c chars oration + ret=$? + print -- $chars x${oration}x $REPLY + return ret +0:regression test: sucessful sysread with both -o and a parameter +>a few words +>12 xx + + oration="do not say these words" + print a few words | sysread -i 0 -o 1 -c chars oration + ret=$? + print -- $chars x${oration}x $REPLY + return ret +0f:successful sysread with both -o and a parameter +F:The value of $oration should be empty or unset when everything is written? +>a few words +>12 xx |