[PATCH 3 of 4] tests: add tests for --binary option in Git mode

Alexander Fomin afomin at fb.com
Tue Apr 4 18:21:22 EDT 2017


# HG changeset patch
# User Alexander Fomin <afomin at fb.com>
# Date 1491335167 25200
#      Tue Apr 04 12:46:07 2017 -0700
# Node ID 373acf7da1a621607a1cc062b96ad67a42a7e016
# Parent  27515c7e38db9d93e18b7df13149da7c0d88eeb2
tests: add tests for --binary option in Git mode

This patch adds some tests to verify correct --binary option behaviour in Git
mode (issue5510).

diff --git a/tests/test-diff-binary-file.t b/tests/test-diff-binary-file.t
--- a/tests/test-diff-binary-file.t
+++ b/tests/test-diff-binary-file.t
@@ -107,4 +107,28 @@
   \ No newline at end of file
   +\x00\x01\x02\x03 (esc)
 
+  $ hg diff --no-binary -r 0 -r 1
+  diff -r fb45f71337ad -r 9ca112d1a3c1 binfile.bin
+  Binary file binfile.bin has changed
+
+  $ hg diff --git --no-binary -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  Binary file binfile.bin has changed
+
+  $ hg diff --git --binary -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  index eaf36c1daccfdf325514461cd1a2ffbc139b5464..ba71a782e93f3fb63a428383706065e3ec2828e9
+  GIT binary patch
+  literal 5
+  Mc${NkWMbw50018V5dZ)H
+  
+
+  $ hg diff --git --binary --config diff.nobinary=True -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  index eaf36c1daccfdf325514461cd1a2ffbc139b5464..ba71a782e93f3fb63a428383706065e3ec2828e9
+  GIT binary patch
+  literal 5
+  Mc${NkWMbw50018V5dZ)H
+  
+
   $ cd ..


More information about the Mercurial-devel mailing list