tests: add testing for diff.showfunc
authorMathias De Maré <mathias.demare@gmail.com>
Tue, 24 Mar 2015 21:36:38 +0100
changeset 24496 9a4ef1b18cae
parent 24495 d2a3a2808974
child 24497 2e0301ac5c91
tests: add testing for diff.showfunc The diff.showfunc config knob did not have coverage before.
tests/test-diff-unified.t
--- a/tests/test-diff-unified.t	Mon Mar 30 10:43:52 2015 -0700
+++ b/tests/test-diff-unified.t	Tue Mar 24 21:36:38 2015 +0100
@@ -286,4 +286,51 @@
   -b
   +a
 
+showfunc diff
+  $ cat > f1 << EOF
+  > int main() {
+  >     int a = 0;
+  >     int b = 1;
+  >     int c = 2;
+  >     int d = 3;
+  >     return a + b + c + d;
+  > }
+  > EOF
+  $ hg commit -m addfunction
+  $ cat > f1 << EOF
+  > int main() {
+  >     int a = 0;
+  >     int b = 1;
+  >     int c = 2;
+  >     int e = 3;
+  >     return a + b + c + e;
+  > }
+  > EOF
+  $ hg diff --git
+  diff --git a/f1 b/f1
+  --- a/f1
+  +++ b/f1
+  @@ -2,6 +2,6 @@
+       int a = 0;
+       int b = 1;
+       int c = 2;
+  -    int d = 3;
+  -    return a + b + c + d;
+  +    int e = 3;
+  +    return a + b + c + e;
+   }
+  $ hg diff --config diff.showfunc=True --git
+  diff --git a/f1 b/f1
+  --- a/f1
+  +++ b/f1
+  @@ -2,6 +2,6 @@ int main() {
+       int a = 0;
+       int b = 1;
+       int c = 2;
+  -    int d = 3;
+  -    return a + b + c + d;
+  +    int e = 3;
+  +    return a + b + c + e;
+   }
+
   $ cd ..