shelltest.od: warning 84 (W84) triggered on *all* shells, not just posh.
I must have changed this at the last minute when adding it, but I don't know why. We were redefining f4() inside a subshell, so it never applied to the parent shell, so it was always considered a failure. But that's not what we were supposed to be testing. This is just supposed to be a test of the really rare syntax of defining a function without enclosing braces, which only fails on posh, as far as I've seen.
This commit is contained in:
parent
0dcc685739
commit
7895c947d5
1 changed files with 4 additions and 4 deletions
|
|
@ -323,8 +323,8 @@ foo=`exit 1`; [ "$?" != 0 ] || fail 72
|
|||
f1() { echo 1; }
|
||||
f2(){ echo 2;}
|
||||
f3()(echo 3)
|
||||
f4() { :; }
|
||||
: $(quiet_stderr eval 'f4()if true; then echo 4; fi')
|
||||
f4() { :; } # Note: redefined on next line
|
||||
quiet_stderr eval 'f4()if true; then echo 4; fi'
|
||||
f5() ( exit 5 )
|
||||
[ "$(f1)" = 1 ] || fail 81
|
||||
[ "$(f2)" = 2 ] || fail 82
|
||||
|
|
@ -499,7 +499,7 @@ false
|
|||
# so we ended up always using bash, which leads people to write .do scripts
|
||||
# with bashisms.
|
||||
set x y z
|
||||
# dotparams.od might warn 115
|
||||
# dotparams.od might warn 115, but should never return nonzero
|
||||
. ./dotparams.od a b || fail 117
|
||||
[ "$1-$2-$3" = "x-y-z" ] || fail 116
|
||||
|
||||
|
|
@ -508,7 +508,7 @@ set x y z
|
|||
# dock it some points so it doesn't always end up as the primary shell.
|
||||
[ 1 == 1 ] 2>/dev/null && warn 118
|
||||
|
||||
# Some shells apparently don't support left padding in printf
|
||||
# Some shells or OSes apparently don't support left padding in printf
|
||||
x=$(printf "a%-5sc" "b")
|
||||
[ "$x" = "ab c" ] || warn 119
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue