commit | 24e0fa09ce0ce4dffc2b28af3d6bccfbe4f0e973 | [log] [tgz] |
---|---|---|
author | Konstantin Shcheglov <scheglov@google.com> | Sun Jan 03 06:52:46 2021 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Sun Jan 03 06:52:46 2021 +0000 |
tree | a80ad3af1039960434a0f40c52655e149672dace | |
parent | d407e16cff550aab55004bdd0fd53a76ce290c49 [diff] |
Fix RemoveUnnecessaryParenthesesTest for Windows. Using absolute offsets does not work well, on Windows lines endings are `\r\n` vs. just `\n` on Mac. R=brianwilkerson@google.com Change-Id: Ia64e532687bcb7b197cff3ffb4514391fcc1d84e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177460 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_parentheses_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_parentheses_test.dart index 206e56f..88b7f30 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_parentheses_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_parentheses_test.dart
@@ -47,7 +47,9 @@ ((42)); } '''); - await assertNoFix(errorFilter: (e) => e.offset == 14); + await assertNoFix( + errorFilter: (e) => e.offset == testCode.indexOf('(42'), + ); } Future<void> test_double_atOuter() async { @@ -60,7 +62,7 @@ void f() { (42); } -''', errorFilter: (e) => e.offset == 13); +''', errorFilter: (e) => e.offset == testCode.indexOf('((42')); } Future<void> test_single() async {