Skip to content

Commit 509d3f5

Browse files
zhanyi22333gitster
authored andcommitted
t9700: modernize test scripts
The style of t9700-perl-git.sh is old. There are 3 problems: * A title is not on the same line with test_expect_success command. * A test body is indented by whitespaces. * There are whitespaces after redirect operators. Modernize test scripts by: * Combine the title with test_expect_success command. * Replace whitespace indents with TAB. * Delete whitespaces after redirect operators. Signed-off-by: Zhang Yi <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 06dd2ba commit 509d3f5

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

t/t9700-perl-git.sh

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,36 @@ skip_all_if_no_Test_More
1313

1414
# set up test repository
1515

16-
test_expect_success \
17-
'set up test repository' \
18-
'echo "test file 1" > file1 &&
19-
echo "test file 2" > file2 &&
20-
mkdir directory1 &&
21-
echo "in directory1" >> directory1/file &&
22-
mkdir directory2 &&
23-
echo "in directory2" >> directory2/file &&
24-
git add . &&
25-
git commit -m "first commit" &&
26-
27-
echo "new file in subdir 2" > directory2/file2 &&
28-
git add . &&
29-
git commit -m "commit in directory2" &&
30-
31-
echo "changed file 1" > file1 &&
32-
git commit -a -m "second commit" &&
33-
34-
git config --add color.test.slot1 green &&
35-
git config --add test.string value &&
36-
git config --add test.dupstring value1 &&
37-
git config --add test.dupstring value2 &&
38-
git config --add test.booltrue true &&
39-
git config --add test.boolfalse no &&
40-
git config --add test.boolother other &&
41-
git config --add test.int 2k &&
42-
git config --add test.path "~/foo" &&
43-
git config --add test.pathexpanded "$HOME/foo" &&
44-
git config --add test.pathmulti foo &&
45-
git config --add test.pathmulti bar
46-
'
16+
test_expect_success 'set up test repository' '
17+
echo "test file 1" >file1 &&
18+
echo "test file 2" >file2 &&
19+
mkdir directory1 &&
20+
echo "in directory1" >>directory1/file &&
21+
mkdir directory2 &&
22+
echo "in directory2" >>directory2/file &&
23+
git add . &&
24+
git commit -m "first commit" &&
25+
26+
echo "new file in subdir 2" >directory2/file2 &&
27+
git add . &&
28+
git commit -m "commit in directory2" &&
29+
30+
echo "changed file 1" >file1 &&
31+
git commit -a -m "second commit" &&
32+
33+
git config --add color.test.slot1 green &&
34+
git config --add test.string value &&
35+
git config --add test.dupstring value1 &&
36+
git config --add test.dupstring value2 &&
37+
git config --add test.booltrue true &&
38+
git config --add test.boolfalse no &&
39+
git config --add test.boolother other &&
40+
git config --add test.int 2k &&
41+
git config --add test.path "~/foo" &&
42+
git config --add test.pathexpanded "$HOME/foo" &&
43+
git config --add test.pathmulti foo &&
44+
git config --add test.pathmulti bar
45+
'
4746

4847
test_expect_success 'set up bare repository' '
4948
git init --bare bare.git

0 commit comments

Comments
 (0)