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:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'testing.dart'; | 8 import 'testing.dart'; |
9 | 9 |
10 var options = ['--warnings_as_errors', '--no-colors', 'memory']; | |
11 | |
12 compileAndValidate(String input, String generated) { | 10 compileAndValidate(String input, String generated) { |
13 var errors = []; | 11 var errors = []; |
14 var stylesheet = compileCss(input, errors: errors, opts: options); | 12 var stylesheet = compileCss(input, errors: errors, opts: options); |
15 expect(stylesheet != null, true); | 13 expect(stylesheet != null, true); |
16 expect(errors.isEmpty, true, reason: errors.toString()); | 14 expect(errors.isEmpty, true, reason: errors.toString()); |
17 expect(prettyPrint(stylesheet), generated); | 15 expect(prettyPrint(stylesheet), generated); |
18 } | 16 } |
19 | 17 |
20 void simpleExtend() { | 18 void simpleExtend() { |
21 compileAndValidate(r''' | 19 compileAndValidate(r''' |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 224 |
227 main() { | 225 main() { |
228 test("Simple Extend", simpleExtend); | 226 test("Simple Extend", simpleExtend); |
229 test("complex", complexSelectors); | 227 test("complex", complexSelectors); |
230 test("multiple", multipleExtends); | 228 test("multiple", multipleExtends); |
231 test("chaining", chaining); | 229 test("chaining", chaining); |
232 test("nested selectors", nestedSelectors); | 230 test("nested selectors", nestedSelectors); |
233 test("nested many selector sequences", nestedMulty); | 231 test("nested many selector sequences", nestedMulty); |
234 test("N-way extends", nWayExtends); | 232 test("N-way extends", nWayExtends); |
235 } | 233 } |
OLD | NEW |