Skip to content

Commit

Permalink
fix(test): resolve range error when truncating due to whitespace (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Mar 22, 2022
1 parent 1b6d192 commit d194b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/cli/flutter_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ extension on int {
extension on String {
String truncated(int maxLength) {
if (length <= maxLength) return this;
final truncated = trim().substring(length - maxLength, length);
final truncated = substring(length - maxLength, length).trim();
return '...$truncated';
}
}
2 changes: 1 addition & 1 deletion test/src/cli/flutter_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void main() {
expect(true, isFalse);
});
test('superrrrrrrextraaaaaareeeeeaaaaalllllllllyyyyyyyyyyyloooonnnnnnngggggggggtestttttttttttttttnameeeeeeeeeeeeeeeee', () {
test('superrrrrrr extraaaaaa reeeeeaaaaalllllllllyyyyyyyyyyy loooonnnnnnnggggggggg testtttttttttttttt nameeeeeeeeeeeeeeeee', () {
expect(true, isFalse);
}, skip: true);
}''';
Expand Down

0 comments on commit d194b6c

Please sign in to comment.