OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library testing.test_description; | 5 library testing.test_description; |
6 | 6 |
7 import 'dart:io' show | 7 import 'dart:io' show |
8 File, | 8 File, |
9 FileSystemEntity; | 9 FileSystemEntity; |
10 | 10 |
11 class TestDescription implements Comparable<TestDescription> { | 11 class TestDescription implements Comparable<TestDescription> { |
12 final Uri root; | 12 final Uri root; |
13 final File file; | 13 final File file; |
14 final Uri output; | 14 final Uri output; |
15 | 15 |
| 16 /// If non-null, this is a generated multitest, and the set contains the |
| 17 /// expected outcomes. |
| 18 Set<String> multitestExpectations; |
| 19 |
16 TestDescription(this.root, this.file, {this.output}); | 20 TestDescription(this.root, this.file, {this.output}); |
17 | 21 |
18 Uri get uri => file.uri; | 22 Uri get uri => file.uri; |
19 | 23 |
20 String get shortName { | 24 String get shortName { |
21 String baseName = "$uri".substring("$root".length); | 25 String baseName = "$uri".substring("$root".length); |
22 return baseName.substring(0, baseName.length - ".dart".length); | 26 return baseName.substring(0, baseName.length - ".dart".length); |
23 } | 27 } |
24 | 28 |
25 String get escapedName => shortName.replaceAll("/", "__"); | 29 String get escapedName => shortName.replaceAll("/", "__"); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 62 |
59 String formatError(String message) { | 63 String formatError(String message) { |
60 String base = Uri.base.toFilePath(); | 64 String base = Uri.base.toFilePath(); |
61 String path = uri.toFilePath(); | 65 String path = uri.toFilePath(); |
62 if (path.startsWith(base)) { | 66 if (path.startsWith(base)) { |
63 path = path.substring(base.length); | 67 path = path.substring(base.length); |
64 } | 68 } |
65 return "$path:$message"; | 69 return "$path:$message"; |
66 } | 70 } |
67 } | 71 } |
OLD | NEW |