From 935c68573f8e63468723dc2691957637e4e6bcb7 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 10 Jan 2019 18:48:02 -0500 Subject: Import /usr/src/bin/sh from FreeBSD 12.0-RELEASE --- bin/cash/tests/builtins/command8.0 | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 bin/cash/tests/builtins/command8.0 (limited to 'bin/cash/tests/builtins/command8.0') diff --git a/bin/cash/tests/builtins/command8.0 b/bin/cash/tests/builtins/command8.0 new file mode 100644 index 00000000..50dfac3e --- /dev/null +++ b/bin/cash/tests/builtins/command8.0 @@ -0,0 +1,45 @@ +# $FreeBSD: releng/12.0/bin/sh/tests/builtins/command8.0 213738 2010-10-12 18:20:38Z obrien $ +IFS=, + +SPECIAL="break,\ + :,\ + continue,\ + . /dev/null,\ + eval,\ + exec,\ + export -p,\ + readonly -p,\ + set,\ + shift 0,\ + times,\ + trap,\ + unset foo" + +set -e + +# Check that special builtins can be executed via "command". + +set -- ${SPECIAL} +for cmd in "$@" +do + ${SH} -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null +done + +while :; do + command break + echo Error on line $LINENO +done + +set p q r +command shift 2 +if [ $# -ne 1 ]; then + echo Error on line $LINENO +fi + +( + command exec >/dev/null + echo Error on line $LINENO +) + +set +e +! command shift 2 2>/dev/null -- cgit 1.4.1