[PATCH 1/4] test: modernize style of t4006

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@xxxxxxxxx>
---
 t/t4006-diff-mode.sh |   32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index ff8c2f7..c8f5180 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -8,23 +8,21 @@ test_description='Test mode change diffs.
 '
 . ./test-lib.sh
 
-test_expect_success \
-    'setup' \
-    'echo frotz >rezrov &&
-     git update-index --add rezrov &&
-     tree=`git write-tree` &&
-     echo $tree'
-
-test_expect_success \
-    'chmod' \
-    'test_chmod +x rezrov &&
-     git diff-index $tree >current'
-
-sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
-echo ":100644 100755 X X M	rezrov" >expected
+test_expect_success 'setup' '
+	echo frotz >rezrov &&
+	git update-index --add rezrov &&
+	tree=`git write-tree` &&
+	echo $tree
+'
 
-test_expect_success \
-    'verify' \
-    'test_cmp expected check'
+# $_x40 is defined in test-lib.sh
+sed_script='s/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /'
+test_expect_success 'chmod' '
+	test_chmod +x rezrov &&
+	git diff-index $tree >current &&
+	sed -e "$sed_script" <current >check &&
+	echo ":100644 100755 X X M	rezrov" >expected &&
+	test_cmp expected check
+'
 
 test_done
-- 
1.7.10.539.g288dd

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]