OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 extend_test; | 5 library extend_test; |
6 | 6 |
| 7 import 'package:csslib/src/messages.dart'; |
7 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
8 | 9 |
9 import 'testing.dart'; | 10 import 'testing.dart'; |
10 | 11 |
11 compileAndValidate(String input, String generated) { | 12 compileAndValidate(String input, String generated) { |
12 var errors = []; | 13 var errors = <Message>[]; |
13 var stylesheet = compileCss(input, errors: errors, opts: options); | 14 var stylesheet = compileCss(input, errors: errors, opts: options); |
14 expect(stylesheet != null, true); | 15 expect(stylesheet != null, true); |
15 expect(errors.isEmpty, true, reason: errors.toString()); | 16 expect(errors.isEmpty, true, reason: errors.toString()); |
16 expect(prettyPrint(stylesheet), generated); | 17 expect(prettyPrint(stylesheet), generated); |
17 } | 18 } |
18 | 19 |
19 void simpleExtend() { | 20 void simpleExtend() { |
20 compileAndValidate(r''' | 21 compileAndValidate(r''' |
21 .error { | 22 .error { |
22 border: 1px red; | 23 border: 1px red; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 226 |
226 main() { | 227 main() { |
227 test("Simple Extend", simpleExtend); | 228 test("Simple Extend", simpleExtend); |
228 test("complex", complexSelectors); | 229 test("complex", complexSelectors); |
229 test("multiple", multipleExtends); | 230 test("multiple", multipleExtends); |
230 test("chaining", chaining); | 231 test("chaining", chaining); |
231 test("nested selectors", nestedSelectors); | 232 test("nested selectors", nestedSelectors); |
232 test("nested many selector sequences", nestedMulty); | 233 test("nested many selector sequences", nestedMulty); |
233 test("N-way extends", nWayExtends); | 234 test("N-way extends", nWayExtends); |
234 } | 235 } |
OLD | NEW |