t3010: modernize style

In particular: - move test preparations inside test_expect_success - place test description on the test_expect_success line - indent with a tab Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Jun 7, 2013 at 22:53 UTC cb648689b9456a1131b494065d7888c925265ddd
1 file changed +61 -62
t/t3010-ls-files-killed-modified.sh
+61 -62
@@ -37,71 +37,70 @@ modified without reporting path9 and path10.
37 '
38 . ./test-lib.sh
39
40 -date >path0
41 -if test_have_prereq SYMLINKS
42 -then
43 - ln -s xyzzy path1
44 -else
45 - date > path1
46 -fi
47 -mkdir path2 path3
48 -date >path2/file2
49 -date >path3/file3
50 -: >path7
51 -date >path8
52 -: >path9
53 -date >path10
54 -test_expect_success \
55 - 'git update-index --add to add various paths.' \
56 - "git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10"
57 -
58 -rm -fr path? ;# leave path10 alone
59 -date >path2
60 -if test_have_prereq SYMLINKS
61 -then
62 - ln -s frotz path3
63 - ln -s nitfol path5
64 -else
65 - date > path3
66 - date > path5
67 -fi
68 -mkdir path0 path1 path6
69 -date >path0/file0
70 -date >path1/file1
71 -date >path6/file6
72 -date >path7
73 -: >path8
74 -: >path9
75 -touch path10
40 +test_expect_success 'git update-index --add to add various paths.' '
41 + date >path0 &&
42 + if test_have_prereq SYMLINKS
43 + then
44 + ln -s xyzzy path1
45 + else
46 + date > path1
47 + fi &&
48 + mkdir path2 path3 &&
49 + date >path2/file2 &&
50 + date >path3/file3 &&
51 + : >path7 &&
52 + date >path8 &&
53 + : >path9 &&
54 + date >path10 &&
55 + git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&
56 + rm -fr path? # leave path10 alone
57 +'
58
77 -test_expect_success \
78 - 'git ls-files -k to show killed files.' \
79 - 'git ls-files -k >.output'
80 -cat >.expected <<EOF
81 -path0/file0
82 -path1/file1
83 -path2
84 -path3
85 -EOF
59 +test_expect_success 'git ls-files -k to show killed files.' '
60 + date >path2 &&
61 + if test_have_prereq SYMLINKS
62 + then
63 + ln -s frotz path3 &&
64 + ln -s nitfol path5
65 + else
66 + date >path3 &&
67 + date >path5
68 + fi &&
69 + mkdir path0 path1 path6 &&
70 + date >path0/file0 &&
71 + date >path1/file1 &&
72 + date >path6/file6 &&
73 + date >path7 &&
74 + : >path8 &&
75 + : >path9 &&
76 + touch path10 &&
77 + git ls-files -k >.output
78 +'
79
87 -test_expect_success \
88 - 'validate git ls-files -k output.' \
89 - 'test_cmp .expected .output'
80 +test_expect_success 'validate git ls-files -k output.' '
81 + cat >.expected <<-\EOF &&
82 + path0/file0
83 + path1/file1
84 + path2
85 + path3
86 + EOF
87 + test_cmp .expected .output
88 +'
89
91 -test_expect_success \
92 - 'git ls-files -m to show modified files.' \
93 - 'git ls-files -m >.output'
94 -cat >.expected <<EOF
95 -path0
96 -path1
97 -path2/file2
98 -path3/file3
99 -path7
100 -path8
101 -EOF
90 +test_expect_success 'git ls-files -m to show modified files.' '
91 + git ls-files -m >.output
92 +'
93
103 -test_expect_success \
104 - 'validate git ls-files -m output.' \
105 - 'test_cmp .expected .output'
94 +test_expect_success 'validate git ls-files -m output.' '
95 + cat >.expected <<-\EOF &&
96 + path0
97 + path1
98 + path2/file2
99 + path3/file3
100 + path7
101 + path8
102 + EOF
103 + test_cmp .expected .output
104 +'
105
106 test_done