Chromium Code Reviews| Index: pkg/csslib/test/var_test.dart |
| diff --git a/pkg/csslib/test/var_test.dart b/pkg/csslib/test/var_test.dart |
| index afdc570232281c50a367633c71b309523e1ac58f..11e94be3d5207a312b90399a1adfbb57760d4c07 100644 |
| --- a/pkg/csslib/test/var_test.dart |
| +++ b/pkg/csslib/test/var_test.dart |
| @@ -623,6 +623,31 @@ var-color-foreground: #00f; |
| expect(prettyPrint(stylesheet), generated2); |
| } |
| +void polyfill() { |
| + var errors = []; |
| + var input = r''' |
| +@color-background: red; |
| +@color-foreground: blue; |
| +.test { |
| + background-color: @color-background; |
| + color: @color-foreground; |
| +}'''; |
| + |
| + var generated = r'''.test { |
| + background-color: #f00; |
| + color: #00f; |
| +}'''; |
| + |
| + var stylesheet = compileCss(input, errors: errors, |
| + opts: ['--no-colors', 'memory'], polyfill: true); |
|
Siggi Cherem (dart-lang)
2013/09/09 19:53:38
should we also test the other features like var(a)
terry
2013/09/09 20:04:50
Yes, I will however "@foo: red;" and "var-foo; red
|
| + |
| + expect(stylesheet != null, true); |
| + expect(errors.isEmpty, true, reason: errors.toString()); |
| + expect(prettyPrint(stylesheet), generated); |
| +} |
| + |
| + |
| + |
| main() { |
| test('Simple var', simpleVar); |
| test('Expressions var', expressionsVar); |
| @@ -631,4 +656,5 @@ main() { |
| test('Var syntax', testVar); |
| test('Cycles var', cyclesVar); |
| test('Less syntax', testLess); |
| + test('Polyfill', polyfill); |
| } |