Skip to content

Commit 45e4a0e

Browse files
Fix a TextSpan test (flutter#135187)
`TextSpan.toStringDeep()` returns a string that contains a lengthy diagnostic message instead of the plain string.
1 parent d0664bc commit 45e4a0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/flutter/test/rendering/paragraph_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ void main() {
436436
expect(paragraph.size.width, 78.0);
437437
expect(paragraph.size.height, 26.0);
438438

439+
final int length = testSpan.toPlainText().length;
439440
// Test the sizes of nested spans.
440-
final String text = testSpan.toStringDeep();
441441
final List<ui.TextBox> boxes = <ui.TextBox>[
442-
for (int i = 0; i < text.length; ++i)
442+
for (int i = 0; i < length; ++i)
443443
...paragraph.getBoxesForSelection(
444444
TextSelection(baseOffset: i, extentOffset: i + 1),
445445
),
446446
];
447-
expect(boxes.length, equals(4));
447+
expect(boxes, hasLength(4));
448448

449449
expect(boxes[0].toRect().width, 13.0);
450450
expect(boxes[0].toRect().height, 13.0);

0 commit comments

Comments
 (0)