# [GSOC] [PATCH 0/3] t9700:moderizen test scripts

4 messages from 2023-02-23 to 2023-02-23. Participants: Zhang Yi.
Thread: https://gitlist.dev/t/59299

## Zhang Yi, 2023-02-23 14:15

Subject: [GSOC] [PATCH 0/3] t9700:moderizen test scripts
Message-ID: <20230223141520.1967625-1-18994118902@163.com>
URL: https://gitlist.dev/e/20230223141520.1967625-1-18994118902%40163.com

```
The style of t9700-perl-git.sh is old.There are 3 things need improve:
* 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.

---
Thanks for all suggestions.

Zhang Yi (3):
  t9700:fix title style
  t9700:change indents to TAB
  t9700:delete whitespaces after redirect operators

 t/t9700-perl-git.sh | 61 ++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 31 deletions(-)

-- 
2.29.0-rc0


```

## Zhang Yi, 2023-02-23 14:15

Subject: [GSOC] [PATCH v2 2/3] t9700:change indents to TAB
Message-ID: <20230223141520.1967625-3-18994118902@163.com>
URL: https://gitlist.dev/e/20230223141520.1967625-3-18994118902%40163.com
In-Reply-To: <20230223141520.1967625-1-18994118902@163.com>

```
The body of one test script in t9700-perl-git.sh is indented by spaces
while others are indented by TAB.And test bodies should be indented with
TAB, not spaces.

Replace all space indents by TAB.

Signed-off-by: Zhang Yi <18994118902@163.com>
---
 t/t9700-perl-git.sh | 58 ++++++++++++++++++++++-----------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index 3f6396ef63..671875a3fc 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -14,35 +14,35 @@ skip_all_if_no_Test_More
 # set up test repository
 
 test_expect_success 'set up test repository' '
-     echo "test file 1" > file1 &&
-     echo "test file 2" > file2 &&
-     mkdir directory1 &&
-     echo "in directory1" >> directory1/file &&
-     mkdir directory2 &&
-     echo "in directory2" >> directory2/file &&
-     git add . &&
-     git commit -m "first commit" &&
-
-     echo "new file in subdir 2" > directory2/file2 &&
-     git add . &&
-     git commit -m "commit in directory2" &&
-
-     echo "changed file 1" > file1 &&
-     git commit -a -m "second commit" &&
-
-     git config --add color.test.slot1 green &&
-     git config --add test.string value &&
-     git config --add test.dupstring value1 &&
-     git config --add test.dupstring value2 &&
-     git config --add test.booltrue true &&
-     git config --add test.boolfalse no &&
-     git config --add test.boolother other &&
-     git config --add test.int 2k &&
-     git config --add test.path "~/foo" &&
-     git config --add test.pathexpanded "$HOME/foo" &&
-     git config --add test.pathmulti foo &&
-     git config --add test.pathmulti bar
-     '
+	echo "test file 1" > file1 &&
+	echo "test file 2" > file2 &&
+	mkdir directory1 &&
+	echo "in directory1" >> directory1/file &&
+	mkdir directory2 &&
+	echo "in directory2" >> directory2/file &&
+	git add . &&
+	git commit -m "first commit" &&
+
+	echo "new file in subdir 2" > directory2/file2 &&
+	git add . &&
+	git commit -m "commit in directory2" &&
+
+	echo "changed file 1" > file1 &&
+	git commit -a -m "second commit" &&
+
+	git config --add color.test.slot1 green &&
+	git config --add test.string value &&
+	git config --add test.dupstring value1 &&
+	git config --add test.dupstring value2 &&
+	git config --add test.booltrue true &&
+	git config --add test.boolfalse no &&
+	git config --add test.boolother other &&
+	git config --add test.int 2k &&
+	git config --add test.path "~/foo" &&
+	git config --add test.pathexpanded "$HOME/foo" &&
+	git config --add test.pathmulti foo &&
+	git config --add test.pathmulti bar
+'
 
 test_expect_success 'set up bare repository' '
 	git init --bare bare.git
-- 
2.29.0-rc0


```

## Zhang Yi, 2023-02-23 14:15

Subject: [GSOC] [PATCH v2 1/3] t9700:fix title style
Message-ID: <20230223141520.1967625-2-18994118902@163.com>
URL: https://gitlist.dev/e/20230223141520.1967625-2-18994118902%40163.com
In-Reply-To: <20230223141520.1967625-1-18994118902@163.com>

```
One title in t9700-perl-git.sh is in old style where the
test_expect_success command and test title are written on
separate lines.

Combine the test_expect_success command and the title in one line.

Signed-off-by: Zhang Yi <18994118902@163.com>
---
 t/t9700-perl-git.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index b105d6d9d5..3f6396ef63 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -13,9 +13,8 @@ skip_all_if_no_Test_More
 
 # set up test repository
 
-test_expect_success \
-    'set up test repository' \
-    'echo "test file 1" > file1 &&
+test_expect_success 'set up test repository' '
+     echo "test file 1" > file1 &&
      echo "test file 2" > file2 &&
      mkdir directory1 &&
      echo "in directory1" >> directory1/file &&
-- 
2.29.0-rc0


```

## Zhang Yi, 2023-02-23 14:15

Subject: [GSOC] [PATCH v2 3/3] t9700:delete whitespaces after redirect operators
Message-ID: <20230223141520.1967625-4-18994118902@163.com>
URL: https://gitlist.dev/e/20230223141520.1967625-4-18994118902%40163.com
In-Reply-To: <20230223141520.1967625-1-18994118902@163.com>

```
There are whitespaces after redirect operators,which is a deprecated
style.

Delete whitespaces after redirect operators.

Signed-off-by: Zhang Yi <18994118902@163.com>
---
 t/t9700-perl-git.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index 671875a3fc..ccc8212d73 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -14,20 +14,20 @@ skip_all_if_no_Test_More
 # set up test repository
 
 test_expect_success 'set up test repository' '
-	echo "test file 1" > file1 &&
-	echo "test file 2" > file2 &&
+	echo "test file 1" >file1 &&
+	echo "test file 2" >file2 &&
 	mkdir directory1 &&
-	echo "in directory1" >> directory1/file &&
+	echo "in directory1" >>directory1/file &&
 	mkdir directory2 &&
-	echo "in directory2" >> directory2/file &&
+	echo "in directory2" >>directory2/file &&
 	git add . &&
 	git commit -m "first commit" &&
 
-	echo "new file in subdir 2" > directory2/file2 &&
+	echo "new file in subdir 2" >directory2/file2 &&
 	git add . &&
 	git commit -m "commit in directory2" &&
 
-	echo "changed file 1" > file1 &&
+	echo "changed file 1" >file1 &&
 	git commit -a -m "second commit" &&
 
 	git config --add color.test.slot1 green &&
-- 
2.29.0-rc0


```
