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 library selector_test; | 5 library selector_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:csslib/parser.dart'; |
| 8 import 'package:test/test.dart'; |
| 9 |
8 import 'testing.dart'; | 10 import 'testing.dart'; |
9 import 'package:csslib/parser.dart'; | |
10 | 11 |
11 void testSelectorSuccesses() { | 12 void testSelectorSuccesses() { |
12 var errors = []; | 13 var errors = []; |
13 var selectorAst = selector('#div .foo', errors: errors); | 14 var selectorAst = selector('#div .foo', errors: errors); |
14 expect(errors.isEmpty, true, reason: errors.toString()); | 15 expect(errors.isEmpty, true, reason: errors.toString()); |
15 expect('#div .foo', compactOuptut(selectorAst)); | 16 expect('#div .foo', compactOuptut(selectorAst)); |
16 | 17 |
17 // Valid selectors for class names. | 18 // Valid selectors for class names. |
18 selectorAst = selector('.foo', errors: errors..clear()); | 19 selectorAst = selector('.foo', errors: errors..clear()); |
19 expect(errors.isEmpty, true, reason: errors.toString()); | 20 expect(errors.isEmpty, true, reason: errors.toString()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 'error on line 1, column 9: name must start with a alpha character, but ' | 59 'error on line 1, column 9: name must start with a alpha character, but ' |
59 'found a number\n' | 60 'found a number\n' |
60 '.foobar .1a-story .xyzzy\n' | 61 '.foobar .1a-story .xyzzy\n' |
61 ' ^^'); | 62 ' ^^'); |
62 } | 63 } |
63 | 64 |
64 main() { | 65 main() { |
65 test('Valid Selectors', testSelectorSuccesses); | 66 test('Valid Selectors', testSelectorSuccesses); |
66 test('Invalid Selectors', testSelectorFailures); | 67 test('Invalid Selectors', testSelectorFailures); |
67 } | 68 } |
OLD | NEW |