[PATCH] tests: added d2u to have unix style testfiles even in textmode

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

 



This is needed if the content of files is compared with
precomputed sha1s or stored expected results.

***WARNING***
This patch is useful for testing and illustrating the problem
but not thought to be applied to any official git branch.

Signed-off-by: Steffen Prohaska <prohaska@xxxxxx>
---
 t/t0000-basic.sh      |    2 +-
 t/t0020-crlf.sh       |    8 ++++----
 t/t0021-conversion.sh |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 4e49d59..bf71ce6 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -91,7 +91,7 @@ test_expect_success \
 mkdir path2 path3 path3/subp3
 for p in path0 path2/file2 path3/file3 path3/subp3/file3
 do
-    echo "hello $p" >$p
+    echo "hello $p" | d2u >$p
     ln -s "hello $p" ${p}sym
 done
 test_expect_success \
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index fe1dfd0..52dc739 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -21,10 +21,10 @@ test_expect_success setup '
 
 	git repo-config core.autocrlf false &&
 
-	for w in Hello world how are you; do echo $w; done >one &&
+	for w in Hello world how are you; do echo $w; done | d2u >one &&
 	mkdir dir &&
-	for w in I am very very fine thank you; do echo $w; done >dir/two &&
-	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul >three &&
+	for w in I am very very fine thank you; do echo $w; done | d2u  >dir/two &&
+	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul | d2u >three &&
 	git add . &&
 
 	git commit -m initial &&
@@ -34,7 +34,7 @@ test_expect_success setup '
 	two=`git rev-parse HEAD:dir/two` &&
 	three=`git rev-parse HEAD:three` &&
 
-	for w in Some extra lines here; do echo $w; done >>one &&
+	for w in Some extra lines here; do echo $w; done | d2u >>one &&
 	git diff >patch.file &&
 	patched=`git hash-object --stdin <one` &&
 	git read-tree --reset -u HEAD &&
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index a839f4e..9ca11bb 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -57,7 +57,7 @@ test_expect_success expanded_in_repo '
 		echo "\$Id:NoSpaceAtFront \$"
 		echo "\$Id:NoSpaceAtEitherEnd\$"
 		echo "\$Id: NoTerminatingSymbol"
-	} > expanded-keywords &&
+	} | d2u > expanded-keywords &&
 
 	{
 		echo "File with expanded keywords"
@@ -68,7 +68,7 @@ test_expect_success expanded_in_repo '
 		echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
 		echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$"
 		echo "\$Id: NoTerminatingSymbol"
-	} > expected-output &&
+	} | d2u > expected-output &&
 
 	git add expanded-keywords &&
 	git commit -m "File with keywords expanded" &&
-- 
1.5.1.2

-
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]

  Powered by Linux