mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +01:00
50159: Tests for sysread, including 50101 regression
This commit is contained in:
parent
afbbde2828
commit
cc264fb58b
2 changed files with 70 additions and 0 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
2022-05-01 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 50159: Test/V14system.ztst: Tests for sysread
|
||||||
|
|
||||||
2022-04-30 Bart Schaefer <schaefer@zsh.org>
|
2022-04-30 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* unposted: Etc/BUGS: remove debian #924736, fixed since 5.8 by
|
* unposted: Etc/BUGS: remove debian #924736, fixed since 5.8 by
|
||||||
|
|
|
||||||
|
|
@ -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
|
0:zsystem flock successful wait test, fractional seconds
|
||||||
?elapsed time seems OK
|
?elapsed time seems OK
|
||||||
F:This timing test might fail due to process scheduling issues unrelated to zsh.
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue