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

tests/basic.sh: fix intermittent spurious regress fail

~- and ~+ are ksh93-specific tilde expansions that expand to
$OLDPWD and $PWD, respectively. On some systems, $OLDPWD is not set
on entry to the test script, because it is not exported to the
environment. This made it unset before any 'cd' was executed,
which (correctly) disabled ~- expansion.

src/cmd/ksh93/tests/basic.sh:
- Before testing 'cd ~-', make sure $OLDPWD is set by cd'ing to
  /dev first (a directory guaranteed by POSIX).
This commit is contained in:
Martijn Dekker 2021-01-18 06:27:08 +00:00
parent 8e8ff5f6f6
commit 7222ba3af7

View file

@ -121,7 +121,10 @@ then set -- TT*
then err_exit 'TT* not expanding when file TT* exists'
fi
fi
cd /dev
cd ~- || err_exit "cd back failed"
cat > $tmp/script <<- !
#! $SHELL
print -r -- \$0