Skip to content

Commit 0a81571

Browse files
committed
Add test to specifically cover surrogate pairs, not just combining characters
1 parent 8565963 commit 0a81571

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/SIL.Machine.Tests/PunctuationAnalysis/TextSegmentTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,14 @@ public void Length()
188188

189189
textSegment = new TextSegment.Builder().SetText("new example text").Build();
190190
Assert.That(textSegment.Length, Is.EqualTo("new example text".Length));
191+
192+
//Combining characters
191193
textSegment = new TextSegment.Builder().SetText("उत्पत्ति पुस्तकले").Build();
192194
Assert.That(textSegment.Length, Is.EqualTo(11));
195+
196+
//Surrogate pairs
197+
textSegment = new TextSegment.Builder().SetText("𝜺𝜺").Build();
198+
Assert.That(textSegment.Length, Is.EqualTo(2));
193199
}
194200

195201
[Test]

0 commit comments

Comments
 (0)