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 'dart:uri'; | 6 import 'dart:uri'; |
6 | 7 |
7 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
8 | 9 |
9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
10 show MessageKind; | 11 show MessageKind; |
11 | 12 |
12 const String SOURCE = """ | 13 const String SOURCE = """ |
13 class Foo { | 14 class Foo { |
14 // Deliberately not const to ensure compile error. | 15 // Deliberately not const to ensure compile error. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 'expected exactly two errors, but got ${compiler.errors}'); | 47 'expected exactly two errors, but got ${compiler.errors}'); |
47 | 48 |
48 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, | 49 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, |
49 compiler.errors[0].message.kind); | 50 compiler.errors[0].message.kind); |
50 Expect.equals("Foo", compiler.errors[0].node.toString()); | 51 Expect.equals("Foo", compiler.errors[0].node.toString()); |
51 | 52 |
52 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, | 53 Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, |
53 compiler.errors[1].message.kind); | 54 compiler.errors[1].message.kind); |
54 Expect.equals("Foo", compiler.errors[1].node.toString()); | 55 Expect.equals("Foo", compiler.errors[1].node.toString()); |
55 } | 56 } |
OLD | NEW |