Skip to content

Commit 69915d8

Browse files
Ramsay Jonesgitster
authored andcommitted
t4016-*.sh: Skip all tests rather than each test
Each test in this file is skipped if the TABS_IN_FILENAMES test prerequisite is set. Use the 'skip_all' facility at the head of the file to skip all of the tests instead. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb8eb64 commit 69915d8

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

t/t4016-diff-quote.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ P1='pathname with HT'
1313
P2='pathname with SP'
1414
P3='pathname
1515
with LF'
16-
if : 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1"
17-
then
18-
test_set_prereq TABS_IN_FILENAMES
19-
else
20-
say 'Your filesystem does not allow tabs in filenames'
21-
fi
16+
echo 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
17+
skip_all='Your filesystem does not allow tabs in filenames'
18+
test_done
19+
}
2220

23-
test_expect_success TABS_IN_FILENAMES setup '
21+
test_expect_success setup '
2422
echo P0.0 >"$P0.0" &&
2523
echo P0.1 >"$P0.1" &&
2624
echo P0.2 >"$P0.2" &&
@@ -40,7 +38,7 @@ test_expect_success TABS_IN_FILENAMES setup '
4038
:
4139
'
4240

43-
test_expect_success TABS_IN_FILENAMES 'setup expected files' '
41+
test_expect_success 'setup expected files' '
4442
cat >expect <<\EOF
4543
rename pathname.1 => "Rpathname\twith HT.0" (100%)
4644
rename pathname.3 => "Rpathname\nwith LF.0" (100%)
@@ -52,12 +50,12 @@ cat >expect <<\EOF
5250
EOF
5351
'
5452

55-
test_expect_success TABS_IN_FILENAMES 'git diff --summary -M HEAD' '
53+
test_expect_success 'git diff --summary -M HEAD' '
5654
git diff --summary -M HEAD >actual &&
5755
test_cmp expect actual
5856
'
5957

60-
test_expect_success TABS_IN_FILENAMES 'git diff --numstat -M HEAD' '
58+
test_expect_success 'git diff --numstat -M HEAD' '
6159
cat >expect <<-\EOF &&
6260
0 0 pathname.1 => "Rpathname\twith HT.0"
6361
0 0 pathname.3 => "Rpathname\nwith LF.0"
@@ -71,7 +69,7 @@ test_expect_success TABS_IN_FILENAMES 'git diff --numstat -M HEAD' '
7169
test_cmp expect actual
7270
'
7371

74-
test_expect_success TABS_IN_FILENAMES 'git diff --stat -M HEAD' '
72+
test_expect_success 'git diff --stat -M HEAD' '
7573
cat >expect <<-\EOF &&
7674
pathname.1 => "Rpathname\twith HT.0" | 0
7775
pathname.3 => "Rpathname\nwith LF.0" | 0

0 commit comments

Comments
 (0)