Unverified Commit 29e0f5f9 authored by LongCatIsLooong's avatar LongCatIsLooong Committed by GitHub

Add regression test for TextPainter.getWordBoundary (#112229)

parent 39b5c9fe
...@@ -1208,6 +1208,21 @@ void main() { ...@@ -1208,6 +1208,21 @@ void main() {
painter.dispose(); painter.dispose();
}); });
test('TextPainter.getWordBoundary works', (){
// Regression test for https://github.com/flutter/flutter/issues/93493 .
const String testCluster = '👨‍👩‍👦👨‍👩‍👦👨‍👩‍👦'; // 8 * 3
final TextPainter textPainter = TextPainter(
text: const TextSpan(text: testCluster),
textDirection: TextDirection.ltr,
);
textPainter.layout();
expect(
textPainter.getWordBoundary(const TextPosition(offset: 8)),
const TextRange(start: 8, end: 16),
);
}, skip: isBrowser); // https://github.com/flutter/flutter/issues/61017
} }
class MockCanvas extends Fake implements Canvas { class MockCanvas extends Fake implements Canvas {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment