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 // TODO(jmesserly): this was factored out of | 5 // TODO(jmesserly): this was factored out of |
6 // dart-lang/sdk/tools/testing/dart/multitest.dart | 6 // dart-lang/sdk/tools/testing/dart/multitest.dart |
7 library dev_compiler.test.tools.multitest; | 7 library dev_compiler.test.tools.multitest; |
8 | 8 |
9 final validMultitestOutcomes = new Set<String>.from([ | 9 final validMultitestOutcomes = new Set<String>.from([ |
10 'ok', | 10 'ok', |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 String key; | 145 String key; |
146 String rest; | 146 String rest; |
147 List<String> outcomesList; | 147 List<String> outcomesList; |
148 _Annotation() {} | 148 _Annotation() {} |
149 factory _Annotation.from(String line) { | 149 factory _Annotation.from(String line) { |
150 // Do an early return with "null" if this is not a valid multitest | 150 // Do an early return with "null" if this is not a valid multitest |
151 // annotation. | 151 // annotation. |
152 if (!line.contains('///')) { | 152 if (!line.contains('///')) { |
153 return null; | 153 return null; |
154 } | 154 } |
155 var parts = line.split('///')[1] | 155 var parts = line |
| 156 .split('///')[1] |
156 .split(':') | 157 .split(':') |
157 .map((s) => s.trim()) | 158 .map((s) => s.trim()) |
158 .where((s) => s.length > 0) | 159 .where((s) => s.length > 0) |
159 .toList(); | 160 .toList(); |
160 if (parts.length <= 1) { | 161 if (parts.length <= 1) { |
161 return null; | 162 return null; |
162 } | 163 } |
163 | 164 |
164 var annotation = new _Annotation(); | 165 var annotation = new _Annotation(); |
165 annotation.key = parts[0]; | 166 annotation.key = parts[0]; |
166 annotation.rest = parts[1]; | 167 annotation.rest = parts[1]; |
167 annotation.outcomesList = | 168 annotation.outcomesList = |
168 annotation.rest.split(',').map((s) => s.trim()).toList(); | 169 annotation.rest.split(',').map((s) => s.trim()).toList(); |
169 return annotation; | 170 return annotation; |
170 } | 171 } |
171 } | 172 } |
OLD | NEW |