Skip to content

Commit

Permalink
Fix a TextSpan test (flutter#135187)
Browse files Browse the repository at this point in the history
`TextSpan.toStringDeep()` returns a string that contains a lengthy diagnostic message instead of the plain string.
  • Loading branch information
LongCatIsLooong authored and Mairramer committed Oct 10, 2023
1 parent f66c8be commit e570ce0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/flutter/test/rendering/paragraph_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,15 @@ void main() {
expect(paragraph.size.width, 78.0);
expect(paragraph.size.height, 26.0);

final int length = testSpan.toPlainText().length;
// Test the sizes of nested spans.
final String text = testSpan.toStringDeep();
final List<ui.TextBox> boxes = <ui.TextBox>[
for (int i = 0; i < text.length; ++i)
for (int i = 0; i < length; ++i)
...paragraph.getBoxesForSelection(
TextSelection(baseOffset: i, extentOffset: i + 1),
),
];
expect(boxes.length, equals(4));
expect(boxes, hasLength(4));

expect(boxes[0].toRect().width, 13.0);
expect(boxes[0].toRect().height, 13.0);
Expand Down

0 comments on commit e570ce0

Please sign in to comment.