Don't sort context messages when verify diagnostics.
Change-Id: I03d9020db1d155798752c253d67ecee2bb36aa5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319383
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 7895fa4..ec24fbd 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -95,13 +95,6 @@
return false;
}
List<DiagnosticMessage> contextMessages = error.contextMessages.toList();
- contextMessages.sort((first, second) {
- int result = first.filePath.compareTo(second.filePath);
- if (result != 0) {
- return result;
- }
- return first.offset - second.offset;
- });
if (contextMessages.length != expectedContextMessages.length) {
return false;
}
diff --git a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
index 44b36cd..e7e3c36 100644
--- a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
@@ -3533,12 +3533,12 @@
124,
10,
contextMessages: [
- ExpectedContextMessage(testFile.path, 31, 14,
- text:
- "The exception is 'The assertion in this constant expression failed.' and occurs here."),
ExpectedContextMessage(testFile.path, 84, 1,
text:
"The evaluated constructor 'A' is called by 'B' and 'B' is defined here."),
+ ExpectedContextMessage(testFile.path, 31, 14,
+ text:
+ "The exception is 'The assertion in this constant expression failed.' and occurs here."),
],
),
]);
@@ -3599,12 +3599,12 @@
101,
9,
contextMessages: [
- ExpectedContextMessage(testFile.path, 23, 19,
- text:
- "The exception is 'The assertion in this constant expression failed.' and occurs here."),
ExpectedContextMessage(testFile.path, 74, 1,
text:
"The evaluated constructor 'A' is called by 'B' and 'B' is defined here."),
+ ExpectedContextMessage(testFile.path, 23, 19,
+ text:
+ "The exception is 'The assertion in this constant expression failed.' and occurs here."),
],
),
]);
diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
index f0701dc..d4c9b60 100644
--- a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
@@ -537,12 +537,12 @@
124,
10,
contextMessages: [
- ExpectedContextMessage(testFile.path, 31, 14,
- text:
- "The exception is 'The assertion in this constant expression failed.' and occurs here."),
ExpectedContextMessage(testFile.path, 84, 1,
text:
"The evaluated constructor 'A' is called by 'B' and 'B' is defined here."),
+ ExpectedContextMessage(testFile.path, 31, 14,
+ text:
+ "The exception is 'The assertion in this constant expression failed.' and occurs here."),
],
),
]);