Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: pkg/csslib/test/var_test.dart

Issue 23868008: Added polyfill for var (moved from web_ui) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« pkg/csslib/lib/src/polyfill.dart ('K') | « pkg/csslib/test/testing.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« pkg/csslib/lib/src/polyfill.dart ('K') | « pkg/csslib/test/testing.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698