@matheusbsbs / matheus-bagliano / commits / b5fa289148
Fork 0

t/t4016-diff-quote: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup work in tests. This improves the skipped statistics on platforms where the test isn't run. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Aug 11, 2010 at 19:04 UTC b5fa2891485353a0cf57300d373e8f85b73b9ca1
1 file changed +15 -7
t/t4016-diff-quote.sh
+15 -7
@@ -13,12 +13,14 @@ P1='pathname with HT'
13 P2='pathname with SP'
14 P3='pathname
15 with LF'
16 -: 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
17 - skip_all='Your filesystem does not allow tabs in filenames, test skipped.'
18 - test_done
19 -}
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
22
21 -test_expect_success setup '
23 +test_expect_success TABS_IN_FILENAMES setup '
24 echo P0.0 >"$P0.0" &&
25 echo P0.1 >"$P0.1" &&
26 echo P0.2 >"$P0.2" &&
@@ -38,6 +40,7 @@ test_expect_success setup '
40 :
41 '
42
43 +test_expect_success TABS_IN_FILENAMES 'setup expected files' '
44 cat >expect <<\EOF
45 rename pathname.1 => "Rpathname\twith HT.0" (100%)
46 rename pathname.3 => "Rpathname\nwith LF.0" (100%)
@@ -47,11 +50,14 @@ cat >expect <<\EOF
50 rename pathname.0 => Rpathname.0 (100%)
51 rename "pathname\twith HT.0" => Rpathname.1 (100%)
52 EOF
50 -test_expect_success 'git diff --summary -M HEAD' '
53 +'
54 +
55 +test_expect_success TABS_IN_FILENAMES 'git diff --summary -M HEAD' '
56 git diff --summary -M HEAD >actual &&
57 test_cmp expect actual
58 '
59
60 +test_expect_success TABS_IN_FILENAMES 'setup expected files' '
61 cat >expect <<\EOF
62 pathname.1 => "Rpathname\twith HT.0" | 0
63 pathname.3 => "Rpathname\nwith LF.0" | 0
@@ -62,7 +68,9 @@ cat >expect <<\EOF
68 "pathname\twith HT.0" => Rpathname.1 | 0
69 7 files changed, 0 insertions(+), 0 deletions(-)
70 EOF
65 -test_expect_success 'git diff --stat -M HEAD' '
71 +'
72 +
73 +test_expect_success TABS_IN_FILENAMES 'git diff --stat -M HEAD' '
74 git diff --stat -M HEAD >actual &&
75 test_cmp expect actual
76 '