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

tests/builtins.sh: fix disabled 'read -s' test

src/cmd/ksh93/tests/builtins.sh:
- An original AT&T test for 'read -s' was disabled and marked
  FIXME. Fix the invalid invocation and check that 'read -s'
  actually writes to the history file.
- Remove a temporary 'command -p ls' debug test that I accidentally
  committed (re: a197b042).
This commit is contained in:
Martijn Dekker 2021-05-05 03:51:40 +01:00
parent 655c4be1c1
commit 38654f0946

View file

@ -267,10 +267,13 @@ x2=.000000001
if [[ $(printf "%g\n" x2 2>/dev/null) != 1e-09 ]] if [[ $(printf "%g\n" x2 2>/dev/null) != 1e-09 ]]
then err_exit 'printf "%g" not working correctly' then err_exit 'printf "%g" not working correctly'
fi fi
#FIXME#($SHELL read -s foobar <<\!
#FIXME#testing (read -s foobar <<<testing_read_s) 2> /dev/null || err_exit "'read -s var' fails"
#FIXME#! exp=$'^[[:digit:]]+\ttesting_read_s$'
#FIXME#) 2> /dev/null || err_exit ksh read -s var fails got=$(fc -l -0)
[[ $got =~ $exp ]] || err_exit "'read -s' did not write to history file" \
"(expected match of regex $(printf %q "$exp"), got $(printf %q "$got"))"
if [[ $(printf +3 2>/dev/null) != +3 ]] if [[ $(printf +3 2>/dev/null) != +3 ]]
then err_exit 'printf is not processing formats beginning with + correctly' then err_exit 'printf is not processing formats beginning with + correctly'
fi fi
@ -769,7 +772,6 @@ printf '\\\000' | read -r -d ''
# ====== # ======
# BUG_CMDSPASGN: Preceding a special builtin with 'command' should disable its special properties. # BUG_CMDSPASGN: Preceding a special builtin with 'command' should disable its special properties.
# Test that assignments preceding 'command' are local. # Test that assignments preceding 'command' are local.
command -p ls
for arg in '' -v -V -p -x for arg in '' -v -V -p -x
do do
for cmd in '' : true ls eval 'eval :' 'eval true' 'eval ls' for cmd in '' : true ls eval 'eval :' 'eval true' 'eval ls'