diff tests/test-diff-unified.t @ 23298:dc4d0c7b7d94

diff: add a --noprefix option See previous patch descriptions for the motivation. The tests reflect the current state of the world -- as we add support we'll see changes in the test output.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 13 Nov 2014 00:13:48 -0800
parents d7abae94a7a0
children 1f510efcd5f3
line wrap: on
line diff
--- a/tests/test-diff-unified.t	Thu Nov 13 00:08:44 2014 -0800
+++ b/tests/test-diff-unified.t	Thu Nov 13 00:13:48 2014 -0800
@@ -89,7 +89,7 @@
   abort: diff context lines count must be an integer, not 'foo'
   [255]
 
-noprefix config
+noprefix config and option
 
   $ hg --config diff.noprefix=True diff --nodates
   diff -r cf9f4ba66af2 a
@@ -104,8 +104,21 @@
    a
    a
    c
+  $ hg diff --noprefix --nodates
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
 
-noprefix disabled in plain mode
+noprefix config disabled in plain mode, but option still enabled
 
   $ HGPLAIN=1 hg --config diff.noprefix=True diff --nodates
   diff -r cf9f4ba66af2 a
@@ -120,6 +133,19 @@
    a
    a
    c
+  $ HGPLAIN=1 hg diff --noprefix --nodates
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
 
   $ cd ..
 
@@ -215,7 +241,7 @@
   -a
   +b
 
-noprefix config disabled in plain mode
+noprefix config disabled in plain mode, but option still enabled
 
   $ HGPLAIN=1 hg --config diff.noprefix=True diff --git --nodates
   diff --git a/f1 b/f 1
@@ -226,6 +252,15 @@
   @@ -1,1 +1,1 @@
   -a
   +b
+  $ HGPLAIN=1 hg diff --git --noprefix --nodates
+  diff --git a/f1 b/f 1
+  rename from f1
+  rename to f 1
+  --- a/f1
+  +++ b/f 1	
+  @@ -1,1 +1,1 @@
+  -a
+  +b
 
 Regular diff --nodates, file deletion