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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 #header div a { | 188 #header div a { |
189 height: 200px; | 189 height: 200px; |
190 } | 190 } |
191 span { | 191 span { |
192 color: #1f1f1f; | 192 color: #1f1f1f; |
193 }'''; | 193 }'''; |
194 compileAndValidate(input13, generated13); | 194 compileAndValidate(input13, generated13); |
195 } | 195 } |
196 | 196 |
197 void simpleNest() { | 197 void simpleNest() { |
198 final errors = []; | |
199 final input = ''' | 198 final input = ''' |
200 div span { color: green; } | 199 div span { color: green; } |
201 #header { | 200 #header { |
202 color: red; | 201 color: red; |
203 h1 { | 202 h1 { |
204 font-size: 26px; | 203 font-size: 26px; |
205 font-weight: bold; | 204 font-weight: bold; |
206 } | 205 } |
207 p { | 206 p { |
208 font-size: 12px; | 207 font-size: 12px; |
(...skipping 23 matching lines...) Expand all Loading... |
232 #header p a { | 231 #header p a { |
233 text-decoration: none; | 232 text-decoration: none; |
234 } | 233 } |
235 div > span[attr="foo"] { | 234 div > span[attr="foo"] { |
236 color: #ff0; | 235 color: #ff0; |
237 }'''; | 236 }'''; |
238 compileAndValidate(input, generated); | 237 compileAndValidate(input, generated); |
239 } | 238 } |
240 | 239 |
241 void complexNest() { | 240 void complexNest() { |
242 final errors = []; | |
243 final input = ''' | 241 final input = ''' |
244 @font-face { font-family: arial; } | 242 @font-face { font-family: arial; } |
245 div { color: #f0f0f0; } | 243 div { color: #f0f0f0; } |
246 #header + div { | 244 #header + div { |
247 color: url(abc.png); | 245 color: url(abc.png); |
248 *[attr="bar"] { | 246 *[attr="bar"] { |
249 font-size: 26px; | 247 font-size: 26px; |
250 font-weight: bold; | 248 font-weight: bold; |
251 } | 249 } |
252 p~ul { | 250 p~ul { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 main() { | 631 main() { |
634 test('Selector and Nested Variations', selectorVariations); | 632 test('Selector and Nested Variations', selectorVariations); |
635 test('Simple nesting', simpleNest); | 633 test('Simple nesting', simpleNest); |
636 test('Complex nesting', complexNest); | 634 test('Complex nesting', complexNest); |
637 test('@media nesting', mediaNesting); | 635 test('@media nesting', mediaNesting); |
638 test('Simple &', simpleThis); | 636 test('Simple &', simpleThis); |
639 test("Variations &", variationsThis); | 637 test("Variations &", variationsThis); |
640 test('Complex &', complexThis); | 638 test('Complex &', complexThis); |
641 test('& with + selector', thisCombinator); | 639 test('& with + selector', thisCombinator); |
642 } | 640 } |
OLD | NEW |