X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4034-diff-words.sh;h=2e2e103b31332ea2f74de5d5e6e49c00b13dfa8a;hb=b75aea8f5bea614f802256c436b06733486a2088;hp=21db6e95c4dd7ccf2f25d887fc2c42f3adcd4124;hpb=39add7a36feca434ba85267cb76e4fd69bcdc13a;p=git.git diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh index 21db6e95c..2e2e103b3 100755 --- a/t/t4034-diff-words.sh +++ b/t/t4034-diff-words.sh @@ -8,21 +8,13 @@ test_expect_success setup ' git config diff.color.old red git config diff.color.new green + git config diff.color.func magenta ' -decrypt_color () { - sed \ - -e 's/.\[1m//g' \ - -e 's/.\[31m//g' \ - -e 's/.\[32m//g' \ - -e 's/.\[36m//g' \ - -e 's/.\[m//g' -} - word_diff () { test_must_fail git diff --no-index "$@" pre post > output && - decrypt_color < output > output.decrypted && + test_decode_color output.decrypted && test_cmp expect output.decrypted } @@ -47,9 +39,9 @@ cat > expect <<\EOF index 330b04f..5ed8eff 100644 --- a/pre +++ b/post -@@ -1,3 +1,7 @@ +@@ -1,3 +1,7 @@ h(4)h(4),hh[44] - + a = b + c aa = a @@ -68,9 +60,9 @@ cat > expect <<\EOF index 330b04f..5ed8eff 100644 --- a/pre +++ b/post -@@ -1 +1 @@ +@@ -1 +1 @@ h(4)h(4),hh[44] -@@ -3,0 +4,4 @@ a = b + c +@@ -3,0 +4,4 @@ a = b + c aa = a @@ -88,9 +80,9 @@ cat > expect <<\EOF index 330b04f..5ed8eff 100644 --- a/pre +++ b/post -@@ -1,3 +1,7 @@ +@@ -1,3 +1,7 @@ h(4),hh[44] - + a = b + c aa = a @@ -124,9 +116,9 @@ cat > expect <<\EOF index 330b04f..5ed8eff 100644 --- a/pre +++ b/post -@@ -1,3 +1,7 @@ +@@ -1,3 +1,7 @@ h(4),hh[44] - + a = b + c aa = a @@ -166,9 +158,9 @@ cat > expect <<\EOF index 330b04f..5ed8eff 100644 --- a/pre +++ b/post -@@ -1,3 +1,7 @@ +@@ -1,3 +1,7 @@ h(4),hh[44] - + a = b + c aa = a @@ -188,7 +180,7 @@ cat > expect <<\EOF index c29453b..be22f37 100644 --- a/pre +++ b/post -@@ -1 +1 @@ +@@ -1 +1 @@ aaa (aaa) aaa EOF @@ -207,7 +199,7 @@ cat > expect <<\EOF index 289cb9d..2d06f37 100644 --- a/pre +++ b/post -@@ -1 +1 @@ +@@ -1 +1 @@ (: EOF