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

Add regression test (re: e5e1d4b5)

This commit is contained in:
Martijn Dekker 2021-05-19 06:13:16 +02:00
parent e5e1d4b53e
commit 07eb2040e8

View file

@ -1364,5 +1364,12 @@ EOF
. $tmp/foo.sh > /dev/null
[[ ${.sh.file} == $0 ]] || err_exit "\${.sh.file} is not set to the correct value after sourcing a file"
# ======
# SHLVL should be decreased before exec'ing a program
exp=$((SHLVL+1))$'\n'$((SHLVL+2))$'\n'$((SHLVL+1))
got=$("$SHELL" -c 'echo $SHLVL; "$SHELL" -c "echo \$SHLVL"; exec "$SHELL" -c "echo \$SHLVL"')
[[ $got == "$exp" ]] || err_exit "SHLVL not increased correctly" \
"(expected $(printf %q "$exp"), got $(printf %q "$got"))"
# ======
exit $((Errors<125?Errors:125))