| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Test that duplicate library names result in different messages depending | 5 // Test that duplicate library names result in different messages depending |
| 6 // on whether the libraries are based on the same resource. | 6 // on whether the libraries are based on the same resource. |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| 11 import 'package:compiler/src/dart2jslib.dart' show MessageKind; | 11 import 'package:compiler/src/messages.dart' show MessageKind; |
| 12 import 'memory_compiler.dart'; | 12 import 'memory_compiler.dart'; |
| 13 | 13 |
| 14 void check(String kind, | 14 void check(String kind, |
| 15 Iterable<DiagnosticMessage> messages, | 15 Iterable<DiagnosticMessage> messages, |
| 16 List<MessageKind> expectedMessageKinds) { | 16 List<MessageKind> expectedMessageKinds) { |
| 17 Expect.equals(messages.length, expectedMessageKinds.length, | 17 Expect.equals(messages.length, expectedMessageKinds.length, |
| 18 "Unexpected $kind count: $messages"); | 18 "Unexpected $kind count: $messages"); |
| 19 int i = 0; | 19 int i = 0; |
| 20 messages.forEach((DiagnosticMessage message) { | 20 messages.forEach((DiagnosticMessage message) { |
| 21 Expect.equals(expectedMessageKinds[i++], message.message.kind); | 21 Expect.equals(expectedMessageKinds[i++], message.message.kind); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 'foo.dart': """ | 134 'foo.dart': """ |
| 135 library lib; | 135 library lib; |
| 136 """, | 136 """, |
| 137 'bar.dart': """ | 137 'bar.dart': """ |
| 138 library lib; | 138 library lib; |
| 139 """}, | 139 """}, |
| 140 warnings: [MessageKind.DUPLICATED_LIBRARY_NAME, | 140 warnings: [MessageKind.DUPLICATED_LIBRARY_NAME, |
| 141 MessageKind.DUPLICATED_LIBRARY_NAME]); | 141 MessageKind.DUPLICATED_LIBRARY_NAME]); |
| 142 } | 142 } |
| 143 | 143 |
| OLD | NEW |