1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

shtests: fix loose ends

src/cmd/ksh93/tests/variables.sh:
- Tolerate a bit more time for the SECONDS verification test.

src/cmd/ksh93/tests/subshell.sh:
- Replace unportable 'head -c 1' by 'dd bs=1 count=1'
- Remove unnecessary uses of 'whence'.

src/cmd/ksh93/tests/builtins.sh:
- Add a regression test for a weirdly specific 'whence' bug exposed
  by the aforementioned unneccessary uses of 'whence', which only
  shows up on my old Power Mac G5 running Mac OS X 10.3. For all I
  know it's a compiler bug, but let's add a more clear failure for
  it here, in case that happens anywhere else.

(cherry picked from commit c3898bd1e6e40874845771d33a5b37220ef0b06e)
This commit is contained in:
Martijn Dekker 2020-06-08 23:51:57 +02:00
parent 712261c89b
commit fb652a7e50
3 changed files with 9 additions and 3 deletions

View file

@ -679,5 +679,12 @@ expect=$'*: times: incorrect syntax'
actual=$(set +x; eval 'times Extra Args' 2>&1)
[[ $actual == $expect ]] || err_exit "times with args: expected $(printf %q "$expect"), got $(printf %q "$actual"))"
# ======
# 'whence' builtin
PATH=$tmp:$PATH $SHELL <<-\EOF || err_exit "'whence' gets wrong path on init"
wc=$(whence wc)
[[ -x $wc ]]
EOF
# ======
exit $((Errors<125?Errors:125))