tests/test-diff-color.t
changeset 35383 82c3762349ac
parent 35328 4937db58b663
child 37731 5471348921c1
--- a/tests/test-diff-color.t	Sun Dec 10 00:16:11 2017 -0500
+++ b/tests/test-diff-color.t	Mon Dec 11 22:38:31 2017 +0900
@@ -370,3 +370,23 @@
   [diff.deleted|-(to see if it works)]
   [diff.inserted|+three of those lines ][diff.inserted.highlight|have]
   [diff.inserted|+][diff.inserted.highlight|collapsed][diff.inserted| onto one]
+
+multibyte character shouldn't be broken up in word diff:
+
+  $ $PYTHON <<'EOF'
+  > with open("utf8", "wb") as f:
+  >     f.write(b"blah \xe3\x82\xa2 blah\n")
+  > EOF
+  $ hg ci -Am 'add utf8 char' utf8
+  $ $PYTHON <<'EOF'
+  > with open("utf8", "wb") as f:
+  >     f.write(b"blah \xe3\x82\xa4 blah\n")
+  > EOF
+  $ hg ci -m 'slightly change utf8 char' utf8
+  $ hg diff --config experimental.worddiff=True --color=debug -c.
+  [diff.diffline|diff --git a/utf8 b/utf8]
+  [diff.file_a|--- a/utf8]
+  [diff.file_b|+++ b/utf8]
+  [diff.hunk|@@ -1,1 +1,1 @@]
+  [diff.deleted|-blah ][diff.deleted.highlight|\xe3\x82\xa2][diff.deleted| blah] (esc)
+  [diff.inserted|+blah ][diff.inserted.highlight|\xe3\x82\xa4][diff.inserted| blah] (esc)