From af38a3927a7c2c0afff8a6f961d02f6ce396c7e8 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 16 Mar 2019 00:57:03 +0100 Subject: [PATCH] Test utf8 diffing --- src/Test/TestDiff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Test/TestDiff.py b/src/Test/TestDiff.py index 2f80060b..622951a1 100644 --- a/src/Test/TestDiff.py +++ b/src/Test/TestDiff.py @@ -30,6 +30,12 @@ class TestDiff: [] ) == [("-", 11)] + def testUtf8(self): + assert Diff.diff( + ["one", "\xe5\xad\xa6\xe4\xb9\xa0\xe4\xb8\x8b", "two", "three"], + ["one", "\xe5\xad\xa6\xe4\xb9\xa0\xe4\xb8\x8b", "two", "three", "four", "five"] + ) == [("=", 20), ("+", ["four", "five"])] + def testDiffLimit(self): old_f = io.BytesIO(b"one\ntwo\nthree\nhmm\nsix") new_f = io.BytesIO(b"one\ntwo\nthree\nfour\nfive\nsix")