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 import 'package:unittest/unittest.dart'; | 5 import 'package:test/test.dart'; |
6 import 'package:unittest/src/backend/platform_selector/ast.dart'; | 6 import 'package:test/src/backend/platform_selector/ast.dart'; |
7 import 'package:unittest/src/backend/platform_selector/parser.dart'; | 7 import 'package:test/src/backend/platform_selector/parser.dart'; |
8 | 8 |
9 /// A matcher that asserts that a value is a [ConditionalNode]. | 9 /// A matcher that asserts that a value is a [ConditionalNode]. |
10 Matcher _isConditionalNode = | 10 Matcher _isConditionalNode = |
11 new isInstanceOf<ConditionalNode>("ConditionalNode"); | 11 new isInstanceOf<ConditionalNode>("ConditionalNode"); |
12 | 12 |
13 /// A matcher that asserts that a value is an [OrNode]. | 13 /// A matcher that asserts that a value is an [OrNode]. |
14 Matcher _isOrNode = new isInstanceOf<OrNode>("OrNode"); | 14 Matcher _isOrNode = new isInstanceOf<OrNode>("OrNode"); |
15 | 15 |
16 /// A matcher that asserts that a value is an [AndNode]. | 16 /// A matcher that asserts that a value is an [AndNode]. |
17 Matcher _isAndNode = new isInstanceOf<AndNode>("AndNode"); | 17 Matcher _isAndNode = new isInstanceOf<AndNode>("AndNode"); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 (value) => value is VariableNode && value.name == name, | 258 (value) => value is VariableNode && value.name == name, |
259 'is a variable named "$name"'); | 259 'is a variable named "$name"'); |
260 | 260 |
261 void _expectToString(String selector, [String result]) { | 261 void _expectToString(String selector, [String result]) { |
262 if (result == null) result = selector; | 262 if (result == null) result = selector; |
263 expect(_toString(selector), equals(result), | 263 expect(_toString(selector), equals(result), |
264 reason: 'Expected toString of "$selector" to be "$result".'); | 264 reason: 'Expected toString of "$selector" to be "$result".'); |
265 } | 265 } |
266 | 266 |
267 String _toString(String selector) => new Parser(selector).parse().toString(); | 267 String _toString(String selector) => new Parser(selector).parse().toString(); |
OLD | NEW |