tests/test-diff-ignore-whitespace
changeset 4878 372d93f03d3a
parent 3199 096f1c73cdc3
child 8167 6c82beaaa11a
--- a/tests/test-diff-ignore-whitespace	Mon Jul 09 17:41:14 2007 +0300
+++ b/tests/test-diff-ignore-whitespace	Sat Jul 14 12:44:47 2007 -0500
@@ -3,6 +3,7 @@
 # GNU diff is the reference for all of these results.
 
 hgdiff() {
+    echo hg diff $@
     hg diff --nodates "$@"
 }
 
@@ -72,6 +73,39 @@
     hgdiff -Bb
 }
 
+test_added_blank_line_with_other_whitespace() {
+    printf 'hello  world\n \t\ngoodbye world \n' >foo
+
+    echo '>>> three diffs showing added blank line w/other space <<<'
+    hgdiff
+    hgdiff -B
+    hgdiff -b
+    hgdiff -Bb
+}
+
+test_whitespace_changes() {
+    printf 'helloworld\ngoodbye\tworld \n' >foo
+
+    echo '>>> four diffs showing changed whitespace <<<'
+    hgdiff
+    hgdiff -B
+    hgdiff -b
+    hgdiff -Bb
+    hgdiff -w
+}
+
+test_whitespace_changes_and_blank_lines() {
+    printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
+
+    echo '>>> five diffs showing changed whitespace <<<'
+    hgdiff
+    hgdiff -B
+    hgdiff -b
+    hgdiff -Bb
+    hgdiff -w
+    hgdiff -wB
+}
+
 hg init
 printf 'hello world\ngoodbye world\n' >foo
 hg ci -Amfoo -ufoo -d '0 0'
@@ -82,3 +116,6 @@
 test_added_horizontal_space_in_the_middle_of_a_word
 test_increased_horizontal_whitespace_amount
 test_added_blank_line_with_horizontal_whitespace
+test_added_blank_line_with_other_whitespace
+test_whitespace_changes
+test_whitespace_changes_and_blank_lines