Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: pkg/analyzer/test/generated/strong_mode_test.dart

Issue 2021613002: Compare error names in strong_mode_test ignoring order. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/strong_mode_test.dart
diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart
index e1691671c7170bf49250121d5319f893e4fafb63..277f8bb338dc957e6de222e5e3c41861b2c1a8ce 100644
--- a/pkg/analyzer/test/generated/strong_mode_test.dart
+++ b/pkg/analyzer/test/generated/strong_mode_test.dart
@@ -1795,10 +1795,12 @@ class D extends C {
errors.sort((AnalysisError e1, AnalysisError e2) =>
e1.errorCode.name.compareTo(e2.errorCode.name));
- expect(errors.map((e) => e.errorCode.name), [
- 'INVALID_METHOD_OVERRIDE_RETURN_TYPE',
- 'STRONG_MODE_INVALID_METHOD_OVERRIDE'
- ]);
+ expect(
+ errors.map((e) => e.errorCode.name),
+ unorderedEquals([
+ 'INVALID_METHOD_OVERRIDE_RETURN_TYPE',
+ 'STRONG_MODE_INVALID_METHOD_OVERRIDE'
+ ]));
expect(errors[0].message, contains('Iterable<S>'),
reason: 'errors should be in terms of the type parameters '
'at the error location');
@@ -1818,11 +1820,12 @@ class D extends C {
// TODO(jmesserly): this is modified code from assertErrors, which we can't
// use directly because STRONG_MODE_* errors don't have working equality.
List<AnalysisError> errors = analysisContext2.computeErrors(source);
- List errorNames = errors.map((e) => e.errorCode.name).toList();
- expect(errorNames, hasLength(2));
- expect(errorNames, contains('STRONG_MODE_INVALID_METHOD_OVERRIDE'));
expect(
- errorNames, contains('INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND'));
+ errors.map((e) => e.errorCode.name),
+ unorderedEquals([
+ 'INVALID_METHOD_OVERRIDE_TYPE_PARAMETER_BOUND',
+ 'STRONG_MODE_INVALID_METHOD_OVERRIDE'
+ ]));
verify([source]);
}
@@ -1837,10 +1840,12 @@ class D extends C {
// TODO(jmesserly): we can't use assertErrors because STRONG_MODE_* errors
// from CodeChecker don't have working equality.
List<AnalysisError> errors = analysisContext2.computeErrors(source);
- expect(errors.map((e) => e.errorCode.name), [
- 'STRONG_MODE_INVALID_METHOD_OVERRIDE',
- 'INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS'
- ]);
+ expect(
+ errors.map((e) => e.errorCode.name),
+ unorderedEquals([
+ 'STRONG_MODE_INVALID_METHOD_OVERRIDE',
+ 'INVALID_METHOD_OVERRIDE_TYPE_PARAMETERS'
+ ]));
verify([source]);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698