@matheusbsbs / matheus-bagliano / commits / 537a071f41
Fork 0

test more combinations of ignore-whitespace options to diff

There are three flags involved (-w -b and --ignore-space-at-eol) which makes 8 combinations possible in total, but only 3 cases are tested (none, -w alone and -b alone). This adds the other 5 cases. Signed-off-by: Keith Cascio <keith@cs.ucla.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Keith Cascio committed Jan 14, 2009 at 16:48 UTC 537a071f41259c8631284bef28497280cd33db95
1 file changed +27
t/t4015-diff-whitespace.sh
+27
@@ -98,6 +98,12 @@ index d99af23..8b32fb5 100644
98 EOF
99 git diff -w > out
100 test_expect_success 'another test, with -w' 'test_cmp expect out'
101 +git diff -w -b > out
102 +test_expect_failure 'another test, with -w -b' 'test_cmp expect out'
103 +git diff -w --ignore-space-at-eol > out
104 +test_expect_failure 'another test, with -w --ignore-space-at-eol' 'test_cmp expect out'
105 +git diff -w -b --ignore-space-at-eol > out
106 +test_expect_failure 'another test, with -w -b --ignore-space-at-eol' 'test_cmp expect out'
107
108 tr 'Q' '\015' << EOF > expect
109 diff --git a/x b/x
@@ -116,6 +122,27 @@ index d99af23..8b32fb5 100644
122 EOF
123 git diff -b > out
124 test_expect_success 'another test, with -b' 'test_cmp expect out'
125 +git diff -b --ignore-space-at-eol > out
126 +test_expect_failure 'another test, with -b --ignore-space-at-eol' 'test_cmp expect out'
127 +
128 +tr 'Q' '\015' << EOF > expect
129 +diff --git a/x b/x
130 +index d99af23..8b32fb5 100644
131 +--- a/x
132 ++++ b/x
133 +@@ -1,6 +1,6 @@
134 +-whitespace at beginning
135 +-whitespace change
136 +-whitespace in the middle
137 ++ whitespace at beginning
138 ++whitespace change
139 ++white space in the middle
140 + whitespace at end
141 + unchanged line
142 + CR at endQ
143 +EOF
144 +git diff --ignore-space-at-eol > out
145 +test_expect_success 'another test, with --ignore-space-at-eol' 'test_cmp expect out'
146
147 test_expect_success 'check mixed spaces and tabs in indent' '
148