Skip to content

Commit 168eff3

Browse files
marcowsgitster
authored andcommitted
t4034-diff-words: add a test for word diff without context
Signed-off-by: Markus Heidelberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78d553b commit 168eff3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t4034-diff-words.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ test_expect_success 'word diff with runs of whitespace' '
6363
6464
'
6565

66+
cat > expect <<\EOF
67+
<WHITE>diff --git a/pre b/post<RESET>
68+
<WHITE>index 330b04f..5ed8eff 100644<RESET>
69+
<WHITE>--- a/pre<RESET>
70+
<WHITE>+++ b/post<RESET>
71+
<BROWN>@@ -1 +1 @@<RESET>
72+
<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>
73+
<BROWN>@@ -3,0 +4,4 @@ a = b + c<RESET>
74+
75+
<GREEN>aa = a<RESET>
76+
77+
<GREEN>aeff = aeff * ( aaa )<RESET>
78+
EOF
79+
80+
test_expect_failure 'word diff without context' '
81+
82+
word_diff --color-words --unified=0
83+
84+
'
85+
6686
cat > expect <<\EOF
6787
<WHITE>diff --git a/pre b/post<RESET>
6888
<WHITE>index 330b04f..5ed8eff 100644<RESET>

0 commit comments

Comments
 (0)