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

Fix yet more minor bugs related to the regression tests (#389)

- Redirect error output from the ulimit builtin (re: 3e58851f).
- Fix the test failure for 'cd -eP' on illumos by making a directory
  symlink first, then removing the symlink after cd.
- Fix the test failure for 'getconf -l' on illumos by quoting
  strings with the -q option.
- astconf.c: Only quote strings if the -q option was passed.
- Improve error messages from intermittently failing types.sh tests
This commit is contained in:
Johnothan King 2021-12-20 23:44:59 -08:00 committed by Martijn Dekker
parent 0ead68b704
commit e6989853bc
4 changed files with 13 additions and 12 deletions

View file

@ -100,16 +100,16 @@ done
[[ $got == "$exp" ]] || err_exit 'Using $RANDOM in subshell influences reproducible sequence in parent environment' \
"(expected $(printf %q "$exp"), got $(printf %q "$got"))"
# Forking a subshell shouldn't throw away the $RANDOM seed in the main shell
exp=$(ulimit -t unlimited; RANDOM=123; echo $RANDOM)
exp=$(ulimit -t unlimited 2> /dev/null; RANDOM=123; echo $RANDOM)
RANDOM=123
(ulimit -t unlimited; true)
(ulimit -t unlimited 2> /dev/null; true)
got=${ echo $RANDOM ;}
[[ $got == "$exp" ]] || err_exit "Forking a subshell resets the parent shell's \$RANDOM seed" \
"(expected $(printf %q "$exp"), got $(printf %q "$got"))"
# Similarly, forking a subshell shouldn't throw away a seed
# previously set inside of the subshell
exp=$(ulimit -t unlimited; RANDOM=789; echo $RANDOM)
got=$(RANDOM=789; ulimit -t unlimited; echo $RANDOM)
exp=$(ulimit -t unlimited 2> /dev/null; RANDOM=789; echo $RANDOM)
got=$(RANDOM=789; ulimit -t unlimited 2> /dev/null; echo $RANDOM)
[[ $got == "$exp" ]] || err_exit "Forking a subshell resets the subshell's \$RANDOM seed" \
"(expected $(printf %q "$exp"), got $(printf %q "$got"))"
unset N i rand1 rand2