name: exec-simple-1
description:
	Assignments for the execution of a function should not be kept.
category: debian,posix
stdin:
	f() { echo $a; }
	a=1 f
	echo x$a
expected-stdout:
	1
	x
---

name: exec-negate-1
description:
	A negated command is compound and should not trigger exit with set -e
category: debian,posix
stdin:
	set -e
	! true
	echo OK
expected-stdout:
	OK
---

name: compound-commands-as-function-body
description:
	Check that compound commands can be used as function bodies as required
	by POSIX since POSIX.2 3.9.5 Function Definition Command (IEEE Std
	1003.2-1992) and that the function body is not implicitly wrapped in a
	subshell
category: posix
stdin:
	chk() (f ${1-}; echo $out)
	f() for out; do :; done; chk for
	f() case $1 in *) out=$1;; esac; chk case
	f() if :; then out=if; fi; chk
	f() while :; do out=while; break; done; chk
	f() until false; do out=until; break; done; chk
	echo ${out-done}
expected-stdout:
	for
	case
	if
	while
	until
	done
---
