zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] test harness: Emit unified diffs instead of context diffs
@ 2016-06-10 17:36 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2016-06-10 17:36 UTC (permalink / raw)
  To: zsh-workers

---
Does anyone build zsh on a system that doesn't have a working 'diff -u'?

 Test/ztst.zsh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index cdd84b5..8ae06b8 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -333,7 +333,7 @@ ZTST_diff() {
     diff_out=$(diff "$@")
     diff_ret="$?"
     if [[ "$diff_ret" != "0" ]]; then
-      print -r "$diff_out"
+      print -r -- "$diff_out"
     fi
   fi
 
@@ -458,7 +458,7 @@ $(<$ZTST_terr)"
 	rm -rf $ZTST_out
 	print -r -- "${(e)substlines}" >$ZTST_out
       fi
-      if [[ $ZTST_flags != *d* ]] && ! ZTST_diff $diff_out -c $ZTST_out $ZTST_tout; then
+      if [[ $ZTST_flags != *d* ]] && ! ZTST_diff $diff_out -u $ZTST_out $ZTST_tout; then
 	ZTST_testfailed "output differs from expected as shown above for:
 $ZTST_code${$(<$ZTST_terr):+
 Error output:
@@ -470,7 +470,7 @@ $(<$ZTST_terr)}"
 	rm -rf $ZTST_err
 	print -r -- "${(e)substlines}" >$ZTST_err
       fi
-      if [[ $ZTST_flags != *D* ]] && ! ZTST_diff $diff_err -c $ZTST_err $ZTST_terr; then
+      if [[ $ZTST_flags != *D* ]] && ! ZTST_diff $diff_err -u $ZTST_err $ZTST_terr; then
 	ZTST_testfailed "error output differs from expected as shown above for:
 $ZTST_code"
 	return 1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-10 17:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 17:36 [PATCH] test harness: Emit unified diffs instead of context diffs Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).