Add regression test for TextPainter.getWordBoundary (#112229)
This commit is contained in:
@@ -1208,6 +1208,21 @@ void main() {
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user