summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/lib-subtest.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/t/lib-subtest.sh b/t/lib-subtest.sh
index 0737fab98a..cdadc0c7fc 100644
--- a/t/lib-subtest.sh
+++ b/t/lib-subtest.sh
@@ -77,18 +77,22 @@ run_sub_test_lib_test_err () {
_run_sub_test_lib_test_common '!' "$@"
}
+_check_sub_test_lib_test_common () {
+ name="$1" &&
+ sed -e 's/^> //' -e 's/Z$//' >"$name"/expect.out &&
+ test_cmp "$name"/expect.out "$name"/out
+}
+
check_sub_test_lib_test () {
name="$1" # stdin is the expected output from the test
- test_must_be_empty "$name"/err &&
- sed -e 's/^> //' -e 's/Z$//' >"$name"/expect &&
- test_cmp "$name/"expect "$name"/out
+ _check_sub_test_lib_test_common "$name" &&
+ test_must_be_empty "$name"/err
}
check_sub_test_lib_test_err () {
name="$1" # stdin is the expected output from the test
+ _check_sub_test_lib_test_common "$name" &&
# expected error output is in descriptor 3
- sed -e 's/^> //' -e 's/Z$//' >"$name"/expect.out &&
- test_cmp "$name"/expect.out "$name"/out &&
sed -e 's/^> //' -e 's/Z$//' <&3 >"$name"/expect.err &&
test_cmp "$name"/expect.err "$name"/err
}