| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
| 6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
| 7 library analyzer.test.src.task.strong.strong_test_helper; | 7 library analyzer.test.src.task.strong.strong_test_helper; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 files = null; | 39 files = null; |
| 40 }); | 40 }); |
| 41 } | 41 } |
| 42 | 42 |
| 43 /// Adds a file using [addFile] and calls [check]. | 43 /// Adds a file using [addFile] and calls [check]. |
| 44 void checkFile(String content) { | 44 void checkFile(String content) { |
| 45 addFile(content); | 45 addFile(content); |
| 46 check(); | 46 check(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 /// Adds [files] using [addFiles] and calls [check]. | |
| 50 void checkFiles(Map<String, String> files) { | |
| 51 addFiles(files); | |
| 52 check(); | |
| 53 } | |
| 54 | |
| 55 /// Adds a file to check. The file should contain: | 49 /// Adds a file to check. The file should contain: |
| 56 /// | 50 /// |
| 57 /// * all expected failures are listed in the source code using comments | 51 /// * all expected failures are listed in the source code using comments |
| 58 /// immediately in front of the AST node that should contain the error. | 52 /// immediately in front of the AST node that should contain the error. |
| 59 /// | 53 /// |
| 60 /// * errors are formatted as a token `level:Type`, where `level` is the | 54 /// * errors are formatted as a token `level:Type`, where `level` is the |
| 61 /// logging level were the error would be reported at, and `Type` is the | 55 /// logging level were the error would be reported at, and `Type` is the |
| 62 /// concrete subclass of [StaticInfo] that denotes the error. | 56 /// concrete subclass of [StaticInfo] that denotes the error. |
| 63 /// | 57 /// |
| 64 /// For example to check that an assignment produces a type error, you can | 58 /// For example to check that an assignment produces a type error, you can |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 UriKind get uriKind => UriKind.DART_URI; | 537 UriKind get uriKind => UriKind.DART_URI; |
| 544 | 538 |
| 545 bool exists() => true; | 539 bool exists() => true; |
| 546 | 540 |
| 547 Source resolveRelative(Uri relativeUri) => | 541 Source resolveRelative(Uri relativeUri) => |
| 548 throw new UnsupportedError('not expecting relative urls in dart: mocks'); | 542 throw new UnsupportedError('not expecting relative urls in dart: mocks'); |
| 549 | 543 |
| 550 Uri resolveRelativeUri(Uri relativeUri) => | 544 Uri resolveRelativeUri(Uri relativeUri) => |
| 551 throw new UnsupportedError('not expecting relative urls in dart: mocks'); | 545 throw new UnsupportedError('not expecting relative urls in dart: mocks'); |
| 552 } | 546 } |
| OLD | NEW |