From 3be121a05dcd170854a8dac6437b29f297a6ff4e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:01:11 +0200 Subject: Adding upstream version 2.23.4+deb12u1. Signed-off-by: Daniel Baumann --- test/test_helper.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/test_helper.sh (limited to 'test/test_helper.sh') diff --git a/test/test_helper.sh b/test/test_helper.sh new file mode 100644 index 0000000..579780c --- /dev/null +++ b/test/test_helper.sh @@ -0,0 +1,26 @@ +setUp() { + tmpdir=$(mktemp -d) + log="$tmpdir/log" +} + +tearDown() { + rm -rf "$tmpdir" +} + +assertPasses() { + local rc=0 + "$@" > "$log" 2>&1 || rc=$? + if [ "$rc" -ne 0 ]; then + cat "$log" + fail "command failed: «$*» (expected pass)" + fi +} + +assertFails() { + local rc=0 + "$@" > "$log" 2>&1 || rc=$? + if [ "$rc" -eq 0 ]; then + cat "$log" + fail "command passed: «$*» (expected fail)" + fi +} -- cgit v1.2.3