From 6fb2295a25ee4a24b38f4fce1b652a60cedd1b64 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 22:24:28 -0500 Subject: test: `! true` doesn't trip `set -e`, do subshell magic --- test/test-common.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/test-common.sh') diff --git a/test/test-common.sh b/test/test-common.sh index 3df7107..c525dd8 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -70,3 +70,9 @@ empty() ( set +x [[ $(stat -c %s "$1") -eq 0 ]] ) + +# Just using '!' doesn't trip `set -e` +not() ( + set +x + ! eval "$@" +) -- cgit v1.2.2