aboutsummaryrefslogtreecommitdiff
path: root/test/T000-basic.sh
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2017-02-26 15:43:01 +0200
committerDavid Bremner <david@tethera.net>2017-03-09 09:03:40 -0400
commit0497d695ca796c4d19ad5ec08788bbb1f400c58c (patch)
treea398c1a25282da030dc86bf5ac2b64b583b788e3 /test/T000-basic.sh
parentd0cd253b37646d9364d046e1d3edb022a58c105a (diff)
test: require test_begin_subtest before test_expect_code
Unify the subtests by requiring test_begin_subtest before test_expect_code. (Similar change for test_expect_success has already been done.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
Diffstat (limited to 'test/T000-basic.sh')
-rwxr-xr-xtest/T000-basic.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/T000-basic.sh b/test/T000-basic.sh
index 003ab95f..36a7ca4c 100755
--- a/test/T000-basic.sh
+++ b/test/T000-basic.sh
@@ -30,11 +30,9 @@ test_begin_subtest 'tests clean up after themselves'
clean=no
test_expect_success 'test_when_finished clean=yes'
+test_begin_subtest 'tests clean up even after a failure'
cleaner=no
-test_expect_code 1 'tests clean up even after a failure' '
- test_when_finished cleaner=yes &&
- (exit 1)
-'
+test_expect_code 1 'test_when_finished cleaner=yes && (exit 1)'
if test $clean$cleaner != yesyes
then
@@ -42,9 +40,8 @@ then
exit 1
fi
-test_expect_code 2 'failure to clean up causes the test to fail' '
- test_when_finished "(exit 2)"
-'
+test_begin_subtest 'failure to clean up causes the test to fail'
+test_expect_code 2 'test_when_finished "(exit 2)"'
EXPECTED=$TEST_DIRECTORY/test.expected-output
suppress_diff_date() {