File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -61,4 +61,30 @@ public function test_compareFiles() : void
61
61
62
62
$ this ->assertEquals ($ array [1 ][1 ], Diff::INSERTED );
63
63
}
64
+
65
+ public function test_splitUnicodeString () : void
66
+ {
67
+ $ split = Diff::splitCharacters ('öäéç€ ' );
68
+
69
+ $ this ->assertCount (5 , $ split );
70
+ $ this ->assertSame ('ö ' , $ split [0 ]);
71
+ $ this ->assertSame ('ä ' , $ split [1 ]);
72
+ $ this ->assertSame ('é ' , $ split [2 ]);
73
+ $ this ->assertSame ('ç ' , $ split [3 ]);
74
+ $ this ->assertSame ('€ ' , $ split [4 ]);
75
+ }
76
+
77
+ /**
78
+ * @link https://github.com/Mistralys/text-diff/issues/1
79
+ */
80
+ public function test_unicodeCharacters () : void
81
+ {
82
+ $ diff = Diff::compareStrings (
83
+ "Géhu – jun02 (LM). " ,
84
+ "Géhu et al. 1984 (31) – jun02 (LM). " ,
85
+ true
86
+ );
87
+
88
+ $ this ->assertStringContainsString ('<span>é</span> ' , $ diff ->toHTML ());
89
+ }
64
90
}
You can’t perform that action at this time.
0 commit comments