| 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 the '--show-package-warnings' option works as intended. | 5 // Test that the '--show-package-warnings' option works as intended. |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 checkUriSchemes(collector.warnings); | 68 checkUriSchemes(collector.warnings); |
| 69 Expect.equals(hints, collector.hints.length, | 69 Expect.equals(hints, collector.hints.length, |
| 70 'Unexpected hints: ${collector.hints}'); | 70 'Unexpected hints: ${collector.hints}'); |
| 71 checkUriSchemes(collector.hints); | 71 checkUriSchemes(collector.hints); |
| 72 Expect.equals(infos, collector.infos.length, | 72 Expect.equals(infos, collector.infos.length, |
| 73 'Unexpected infos: ${collector.infos}'); | 73 'Unexpected infos: ${collector.infos}'); |
| 74 checkUriSchemes(collector.infos); | 74 checkUriSchemes(collector.infos); |
| 75 print('=================================================================='); | 75 print('=================================================================='); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void checkUriSchemes(Iterable<DiagnosticMessage> messages) { | 78 void checkUriSchemes(Iterable<CollectedMessage> messages) { |
| 79 for (DiagnosticMessage message in messages) { | 79 for (CollectedMessage message in messages) { |
| 80 if (message.uri != null) { | 80 if (message.uri != null) { |
| 81 Expect.notEquals('package', message.uri.scheme, | 81 Expect.notEquals('package', message.uri.scheme, |
| 82 "Unexpected package uri `${message.uri}` in message: $message"); | 82 "Unexpected package uri `${message.uri}` in message: $message"); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void main() { | 87 void main() { |
| 88 asyncTest(() async { | 88 asyncTest(() async { |
| 89 await test( | 89 await test( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 111 showPackageWarnings: true, | 111 showPackageWarnings: true, |
| 112 // From package:pkg_error1 and package:pkg_error2: | 112 // From package:pkg_error1 and package:pkg_error2: |
| 113 warnings: 2, hints: 2, infos: 2); | 113 warnings: 2, hints: 2, infos: 2); |
| 114 await test( | 114 await test( |
| 115 Uri.parse('package:pkg_noerror/pkg_noerror.dart'), | 115 Uri.parse('package:pkg_noerror/pkg_noerror.dart'), |
| 116 showPackageWarnings: false, | 116 showPackageWarnings: false, |
| 117 hints: 2 /* from summary */); | 117 hints: 2 /* from summary */); |
| 118 }); | 118 }); |
| 119 } | 119 } |
| 120 | 120 |
| OLD | NEW |