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..1e773fbdbbe4113c51181b896d2206b332325664 100644 |
| --- a/pkg/front_end/test/kernel_generator_test.dart |
| +++ b/pkg/front_end/test/kernel_generator_test.dart |
| @@ -56,16 +56,18 @@ 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")); |
| + // TODO(sigmund): when we expose codes in the public APIs, we should |
| + // compare the code here and not the message. |
| + expect(errors.first.message, contains("No 'main' method found")); |
|
ahe
2017/07/13 00:03:38
I think this might work:
equals(messageMissingMai
Siggi Cherem (dart-lang)
2017/07/18 00:32:57
Done.
|
| }); |
| 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 +148,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); |