Mercurial > public > mercurial-scm > hg
diff tests/test-diff-ignore-whitespace.t @ 12751:8eb758ea738c
mdiff: carriage return (\r) is also ignorable whitespace
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 19 Oct 2010 03:55:06 +0200 |
parents | aff0b3947020 |
children | 05fffd665170 |
line wrap: on
line diff
--- a/tests/test-diff-ignore-whitespace.t Fri Oct 15 23:00:45 2010 -0500 +++ b/tests/test-diff-ignore-whitespace.t Tue Oct 19 03:55:06 2010 +0200 @@ -390,3 +390,57 @@ $ hg ndiff -wB + +Test \r (carriage return) as used in "DOS" line endings: + + $ printf 'hello world\r\n\r\ngoodbye\rworld\n' >foo + + $ hg ndiff + diff -r 540c40a65b78 foo + --- a/foo + +++ b/foo + @@ -1,2 +1,3 @@ + -hello world + -goodbye world + +hello world + + + +goodbye world +world + +No completely blank lines to ignore: + + $ hg ndiff --ignore-blank-lines + diff -r 540c40a65b78 foo + --- a/foo + +++ b/foo + @@ -1,2 +1,3 @@ + -hello world + -goodbye world + +hello world + + + +goodbye world +world + +Only new line noticed: + + $ hg ndiff --ignore-space-change + diff -r 540c40a65b78 foo + --- a/foo + +++ b/foo + @@ -1,2 +1,3 @@ + hello world + + + goodbye world + + $ hg ndiff --ignore-all-space + diff -r 540c40a65b78 foo + --- a/foo + +++ b/foo + @@ -1,2 +1,3 @@ + hello world + + + goodbye world + +New line not noticed when space change ignored: + + $ hg ndiff --ignore-blank-lines --ignore-all-space