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']; | 10 List optionsCss = ['--no-colors', 'memory']; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 color: red; | 152 color: red; |
153 button, div { | 153 button, div { |
154 span, a, ul { height: 200 } | 154 span, a, ul { height: 200 } |
155 } | 155 } |
156 table { width: 300px; } | 156 table { width: 300px; } |
157 }'''; | 157 }'''; |
158 final generated12 = r'''html, body { | 158 final generated12 = r'''html, body { |
159 color: #f00; | 159 color: #f00; |
160 } | 160 } |
161 ''' | 161 ''' |
162 'html button span, body button span, html div span, body div span, ' | 162 'html button span, body button span, html div span, body div span, ' |
163 'html button a, body button a, html div a, body div a, html button ul, ' | 163 'html button a, body button a, html div a, body div a, html button ul, ' |
164 r'''body button ul, html div ul, body div ul { | 164 r'''body button ul, html div ul, body div ul { |
165 height: 200; | 165 height: 200; |
166 } | 166 } |
167 html table, body table { | 167 html table, body table { |
168 width: 300px; | 168 width: 300px; |
169 }'''; | 169 }'''; |
170 compileAndValidate(input12, generated12); | 170 compileAndValidate(input12, generated12); |
171 | 171 |
172 final input13 = r''' | 172 final input13 = r''' |
173 #header { | 173 #header { |
174 div { | 174 div { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 font-size: 12px; | 208 font-size: 12px; |
209 a { | 209 a { |
210 text-decoration: none; | 210 text-decoration: none; |
211 } | 211 } |
212 } | 212 } |
213 background-color: blue; | 213 background-color: blue; |
214 } | 214 } |
215 div > span[attr="foo"] { color: yellow; } | 215 div > span[attr="foo"] { color: yellow; } |
216 '''; | 216 '''; |
217 | 217 |
218 final generated = | 218 final generated = r'''div span { |
219 r'''div span { | |
220 color: #008000; | 219 color: #008000; |
221 } | 220 } |
222 #header { | 221 #header { |
223 color: #f00; | 222 color: #f00; |
224 background-color: #00f; | 223 background-color: #00f; |
225 } | 224 } |
226 #header h1 { | 225 #header h1 { |
227 font-size: 26px; | 226 font-size: 26px; |
228 font-weight: bold; | 227 font-weight: bold; |
229 } | 228 } |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 main() { | 633 main() { |
635 test('Selector and Nested Variations', selectorVariations); | 634 test('Selector and Nested Variations', selectorVariations); |
636 test('Simple nesting', simpleNest); | 635 test('Simple nesting', simpleNest); |
637 test('Complex nesting', complexNest); | 636 test('Complex nesting', complexNest); |
638 test('@media nesting', mediaNesting); | 637 test('@media nesting', mediaNesting); |
639 test('Simple &', simpleThis); | 638 test('Simple &', simpleThis); |
640 test("Variations &", variationsThis); | 639 test("Variations &", variationsThis); |
641 test('Complex &', complexThis); | 640 test('Complex &', complexThis); |
642 test('& with + selector', thisCombinator); | 641 test('& with + selector', thisCombinator); |
643 } | 642 } |
OLD | NEW |