OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 import "package:expect/expect.dart"; |
5 import 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
6 | 7 |
7 const String SOURCE = """ | 8 const String SOURCE = """ |
8 class Foo { | 9 class Foo { |
9 // Deliberately not const to ensure compile error. | 10 // Deliberately not const to ensure compile error. |
10 Foo(_); | 11 Foo(_); |
11 } | 12 } |
12 | 13 |
13 @Bar() | 14 @Bar() |
14 class Bar { | 15 class Bar { |
(...skipping 26 matching lines...) Expand all Loading... |
41 'expected exactly two errors, but got ${compiler.errors}'); | 42 'expected exactly two errors, but got ${compiler.errors}'); |
42 | 43 |
43 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, | 44 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, |
44 compiler.errors[0].message.kind); | 45 compiler.errors[0].message.kind); |
45 Expect.equals("Foo", compiler.errors[0].node.toString()); | 46 Expect.equals("Foo", compiler.errors[0].node.toString()); |
46 | 47 |
47 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, | 48 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, |
48 compiler.errors[1].message.kind); | 49 compiler.errors[1].message.kind); |
49 Expect.equals("Foo", compiler.errors[1].node.toString()); | 50 Expect.equals("Foo", compiler.errors[1].node.toString()); |
50 } | 51 } |
OLD | NEW |