| 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 nested_test; | 5 library nested_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 List optionsCss = ['--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: optionsCss); | 12 var stylesheet = compileCss(input, errors: errors, opts: simpleOptions); |
| 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 selectorVariations() { | 18 selectorVariations() { |
| 21 final input1 = r'''html { color: red; }'''; | 19 final input1 = r'''html { color: red; }'''; |
| 22 final generated1 = r'''html { | 20 final generated1 = r'''html { |
| 23 color: #f00; | 21 color: #f00; |
| 24 }'''; | 22 }'''; |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 main() { | 629 main() { |
| 632 test('Selector and Nested Variations', selectorVariations); | 630 test('Selector and Nested Variations', selectorVariations); |
| 633 test('Simple nesting', simpleNest); | 631 test('Simple nesting', simpleNest); |
| 634 test('Complex nesting', complexNest); | 632 test('Complex nesting', complexNest); |
| 635 test('@media nesting', mediaNesting); | 633 test('@media nesting', mediaNesting); |
| 636 test('Simple &', simpleThis); | 634 test('Simple &', simpleThis); |
| 637 test("Variations &", variationsThis); | 635 test("Variations &", variationsThis); |
| 638 test('Complex &', complexThis); | 636 test('Complex &', complexThis); |
| 639 test('& with + selector', thisCombinator); | 637 test('& with + selector', thisCombinator); |
| 640 } | 638 } |
| OLD | NEW |