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

Unified Diff: pkg/front_end/test/kernel_generator_test.dart

Issue 2979623002: Use messages for (some) public API errors (Closed)
Patch Set: Created 3 years, 5 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
Index: pkg/front_end/test/kernel_generator_test.dart
diff --git a/pkg/front_end/test/kernel_generator_test.dart b/pkg/front_end/test/kernel_generator_test.dart
index 831dbaf63c5988368269709197a62acb67955afe..cd3d0a953b2c2ddd1066d70407d31c92a5e4031c 100644
--- a/pkg/front_end/test/kernel_generator_test.dart
+++ b/pkg/front_end/test/kernel_generator_test.dart
@@ -56,16 +56,16 @@ main() {
var errors = [];
var options = new CompilerOptions()..onError = (e) => errors.add(e);
await compileScript('a() => print("hi");', options: options);
- expect('${errors.first}', contains("No 'main' method found"));
+ expect(errors.first.message, contains("No 'main' method found"));
Paul Berry 2017/07/11 16:00:59 Would it be possible to change these test assertio
Siggi Cherem (dart-lang) 2017/07/12 00:29:46 In the future, yes, right now we don't expose the
});
test('default error handler throws', () async {
var exceptionThrown = false;
try {
await compileScript('a() => print("hi");');
- } catch (e) {
+ } on CompilationError catch (e) {
exceptionThrown = true;
- expect('$e', contains("No 'main' method found"));
+ expect(e.message, contains("No 'main' method found"));
}
expect(exceptionThrown, isTrue);
});
@@ -146,7 +146,7 @@ main() {
'b.dart': ''
};
await compileUnit(['a.dart'], sources, options: options);
- expect(errors.first.toString(), contains('Invalid access'));
+ expect(errors.first.message, contains('Invalid access'));
errors.clear();
await compileUnit(['a.dart', 'b.dart'], sources, options: options);

Powered by Google App Engine
This is Rietveld 408576698