Skip to content

Commit 5712d62

Browse files
Shubhamlmpgitster
authored andcommitted
t7001: modernize test formatting
Some tests in this script are formatted using a very old style: test_expect_success \ 'title' \ 'body line 1 && body line 2' Update the formatting to the modern style: test_expect_success 'title' ' body line 1 && body line 2 ' Signed-off-by: Shubham Verma <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e1cfff6 commit 5712d62

File tree

1 file changed

+96
-96
lines changed

1 file changed

+96
-96
lines changed

t/t7001-mv.sh

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -3,154 +3,154 @@
33
test_description='git mv in subdirs'
44
. ./test-lib.sh
55

6-
test_expect_success \
7-
'prepare reference tree' \
8-
'mkdir path0 path1 &&
6+
test_expect_success 'prepare reference tree' '
7+
mkdir path0 path1 &&
98
cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
109
git add path0/COPYING &&
11-
git commit -m add -a'
10+
git commit -m add -a
11+
'
1212

13-
test_expect_success \
14-
'moving the file out of subdirectory' \
15-
'cd path0 && git mv COPYING ../path1/COPYING'
13+
test_expect_success 'moving the file out of subdirectory' '
14+
cd path0 && git mv COPYING ../path1/COPYING
15+
'
1616

1717
# in path0 currently
18-
test_expect_success \
19-
'commiting the change' \
20-
'cd .. && git commit -m move-out -a'
18+
test_expect_success 'commiting the change' '
19+
cd .. && git commit -m move-out -a
20+
'
2121

22-
test_expect_success \
23-
'checking the commit' \
24-
'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
25-
grep "^R100..*path0/COPYING..*path1/COPYING" actual'
22+
test_expect_success 'checking the commit' '
23+
git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
24+
grep "^R100..*path0/COPYING..*path1/COPYING" actual
25+
'
2626

27-
test_expect_success \
28-
'moving the file back into subdirectory' \
29-
'cd path0 && git mv ../path1/COPYING COPYING'
27+
test_expect_success 'moving the file back into subdirectory' '
28+
cd path0 && git mv ../path1/COPYING COPYING
29+
'
3030

3131
# in path0 currently
32-
test_expect_success \
33-
'commiting the change' \
34-
'cd .. && git commit -m move-in -a'
35-
36-
test_expect_success \
37-
'checking the commit' \
38-
'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
39-
grep "^R100..*path1/COPYING..*path0/COPYING" actual'
40-
41-
test_expect_success \
42-
'mv --dry-run does not move file' \
43-
'git mv -n path0/COPYING MOVED &&
32+
test_expect_success 'commiting the change' '
33+
cd .. && git commit -m move-in -a
34+
'
35+
36+
test_expect_success 'checking the commit' '
37+
git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
38+
grep "^R100..*path1/COPYING..*path0/COPYING" actual
39+
'
40+
41+
test_expect_success 'mv --dry-run does not move file' '
42+
git mv -n path0/COPYING MOVED &&
4443
test -f path0/COPYING &&
45-
test ! -f MOVED'
44+
test ! -f MOVED
45+
'
4646

47-
test_expect_success \
48-
'checking -k on non-existing file' \
49-
'git mv -k idontexist path0'
47+
test_expect_success 'checking -k on non-existing file' '
48+
git mv -k idontexist path0
49+
'
5050

51-
test_expect_success \
52-
'checking -k on untracked file' \
53-
'touch untracked1 &&
51+
test_expect_success 'checking -k on untracked file' '
52+
touch untracked1 &&
5453
git mv -k untracked1 path0 &&
5554
test -f untracked1 &&
56-
test ! -f path0/untracked1'
55+
test ! -f path0/untracked1
56+
'
5757

58-
test_expect_success \
59-
'checking -k on multiple untracked files' \
60-
'touch untracked2 &&
58+
test_expect_success 'checking -k on multiple untracked files' '
59+
touch untracked2 &&
6160
git mv -k untracked1 untracked2 path0 &&
6261
test -f untracked1 &&
6362
test -f untracked2 &&
6463
test ! -f path0/untracked1 &&
65-
test ! -f path0/untracked2'
64+
test ! -f path0/untracked2
65+
'
6666

67-
test_expect_success \
68-
'checking -f on untracked file with existing target' \
69-
'touch path0/untracked1 &&
67+
test_expect_success 'checking -f on untracked file with existing target' '
68+
touch path0/untracked1 &&
7069
test_must_fail git mv -f untracked1 path0 &&
7170
test ! -f .git/index.lock &&
7271
test -f untracked1 &&
73-
test -f path0/untracked1'
72+
test -f path0/untracked1
73+
'
7474

7575
# clean up the mess in case bad things happen
7676
rm -f idontexist untracked1 untracked2 \
7777
path0/idontexist path0/untracked1 path0/untracked2 \
7878
.git/index.lock
7979
rmdir path1
8080

81-
test_expect_success \
82-
'moving to absent target with trailing slash' \
83-
'test_must_fail git mv path0/COPYING no-such-dir/ &&
81+
test_expect_success 'moving to absent target with trailing slash' '
82+
test_must_fail git mv path0/COPYING no-such-dir/ &&
8483
test_must_fail git mv path0/COPYING no-such-dir// &&
8584
git mv path0/ no-such-dir/ &&
86-
test_path_is_dir no-such-dir'
85+
test_path_is_dir no-such-dir
86+
'
8787

88-
test_expect_success \
89-
'clean up' \
90-
'git reset --hard'
88+
test_expect_success 'clean up' '
89+
git reset --hard
90+
'
9191

92-
test_expect_success \
93-
'moving to existing untracked target with trailing slash' \
94-
'mkdir path1 &&
92+
test_expect_success 'moving to existing untracked target with trailing slash' '
93+
mkdir path1 &&
9594
git mv path0/ path1/ &&
96-
test_path_is_dir path1/path0/'
95+
test_path_is_dir path1/path0/
96+
'
9797

98-
test_expect_success \
99-
'moving to existing tracked target with trailing slash' \
100-
'mkdir path2 &&
98+
test_expect_success 'moving to existing tracked target with trailing slash' '
99+
mkdir path2 &&
101100
>path2/file && git add path2/file &&
102101
git mv path1/path0/ path2/ &&
103-
test_path_is_dir path2/path0/'
102+
test_path_is_dir path2/path0/
103+
'
104104

105-
test_expect_success \
106-
'clean up' \
107-
'git reset --hard'
105+
test_expect_success 'clean up' '
106+
git reset --hard
107+
'
108108

109-
test_expect_success \
110-
'adding another file' \
111-
'cp "$TEST_DIRECTORY"/../README.md path0/README &&
109+
test_expect_success 'adding another file' '
110+
cp "$TEST_DIRECTORY"/../README.md path0/README &&
112111
git add path0/README &&
113-
git commit -m add2 -a'
112+
git commit -m add2 -a
113+
'
114114

115-
test_expect_success \
116-
'moving whole subdirectory' \
117-
'git mv path0 path2'
115+
test_expect_success 'moving whole subdirectory' '
116+
git mv path0 path2
117+
'
118118

119-
test_expect_success \
120-
'commiting the change' \
121-
'git commit -m dir-move -a'
119+
test_expect_success 'commiting the change' '
120+
git commit -m dir-move -a
121+
'
122122

123-
test_expect_success \
124-
'checking the commit' \
125-
'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
123+
test_expect_success 'checking the commit' '
124+
git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
126125
grep "^R100..*path0/COPYING..*path2/COPYING" actual &&
127-
grep "^R100..*path0/README..*path2/README" actual'
126+
grep "^R100..*path0/README..*path2/README" actual
127+
'
128128

129-
test_expect_success \
130-
'succeed when source is a prefix of destination' \
131-
'git mv path2/COPYING path2/COPYING-renamed'
129+
test_expect_success 'succeed when source is a prefix of destination' '
130+
git mv path2/COPYING path2/COPYING-renamed
131+
'
132132

133-
test_expect_success \
134-
'moving whole subdirectory into subdirectory' \
135-
'git mv path2 path1'
133+
test_expect_success 'moving whole subdirectory into subdirectory' '
134+
git mv path2 path1
135+
'
136136

137-
test_expect_success \
138-
'commiting the change' \
139-
'git commit -m dir-move -a'
137+
test_expect_success 'commiting the change' '
138+
git commit -m dir-move -a
139+
'
140140

141-
test_expect_success \
142-
'checking the commit' \
143-
'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
141+
test_expect_success 'checking the commit' '
142+
git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
144143
grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual &&
145-
grep "^R100..*path2/README..*path1/path2/README" actual'
144+
grep "^R100..*path2/README..*path1/path2/README" actual
145+
'
146146

147-
test_expect_success \
148-
'do not move directory over existing directory' \
149-
'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0'
147+
test_expect_success 'do not move directory over existing directory' '
148+
mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0
149+
'
150150

151-
test_expect_success \
152-
'move into "."' \
153-
'git mv path1/path2/ .'
151+
test_expect_success 'move into "."' '
152+
git mv path1/path2/ .
153+
'
154154

155155
test_expect_success "Michael Cassar's test case" '
156156
rm -fr .git papers partA &&

0 commit comments

Comments
 (0)