Chromium Code Reviews| 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); |