summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2012-08-30 10:17:16 +0300
committerMarc Englund <marc@vaadin.com>2012-08-30 10:17:16 +0300
commite71794ee177e309a4cba15ebd6b65d5950721dd7 (patch)
tree52df34791e76325c0c1f4ac5385d394610c3e288 /tests
parent269746aa7843e41a7aa4dd3cf9da731dc18a7d43 (diff)
parent3d757bddfc2a07a77879fb3310e6dbbc49a1a079 (diff)
downloadvaadin-framework-e71794ee177e309a4cba15ebd6b65d5950721dd7.tar.gz
vaadin-framework-e71794ee177e309a4cba15ebd6b65d5950721dd7.zip
Merge branch 'sass'
Diffstat (limited to 'tests')
-rw-r--r--tests/sass/resources/css/var-guarded.css4
-rw-r--r--tests/sass/resources/scss/var-guarded.scss8
-rw-r--r--tests/sass/src/com/vaadin/sass/testcases/scss/VariableGuarded.java36
3 files changed, 48 insertions, 0 deletions
diff --git a/tests/sass/resources/css/var-guarded.css b/tests/sass/resources/css/var-guarded.css
new file mode 100644
index 0000000000..c4a8c49d12
--- /dev/null
+++ b/tests/sass/resources/css/var-guarded.css
@@ -0,0 +1,4 @@
+#main {
+ content: "First content";
+ new-content: "First time reference";
+} \ No newline at end of file
diff --git a/tests/sass/resources/scss/var-guarded.scss b/tests/sass/resources/scss/var-guarded.scss
new file mode 100644
index 0000000000..8f7aab8fa9
--- /dev/null
+++ b/tests/sass/resources/scss/var-guarded.scss
@@ -0,0 +1,8 @@
+$content: "First content";
+$content: "Second content?" !default;
+$new_content: "First time reference" !default;
+
+#main {
+ content: $content;
+ new-content: $new_content;
+} \ No newline at end of file
diff --git a/tests/sass/src/com/vaadin/sass/testcases/scss/VariableGuarded.java b/tests/sass/src/com/vaadin/sass/testcases/scss/VariableGuarded.java
new file mode 100644
index 0000000000..2c37737e69
--- /dev/null
+++ b/tests/sass/src/com/vaadin/sass/testcases/scss/VariableGuarded.java
@@ -0,0 +1,36 @@
+package com.vaadin.sass.testcases.scss;
+
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+import org.w3c.css.sac.CSSException;
+
+import com.vaadin.sass.AbstractTestBase;
+import com.vaadin.sass.ScssStylesheet;
+import com.vaadin.sass.handler.SCSSDocumentHandler;
+import com.vaadin.sass.handler.SCSSDocumentHandlerImpl;
+import com.vaadin.sass.parser.Parser;
+
+public class VariableGuarded extends AbstractTestBase {
+ String scss = "/scss/var-guarded.scss";
+ String css = "/css/var-guarded.css";
+
+ @Test
+ public void testParser() throws CSSException, IOException {
+ Parser parser = new Parser();
+ SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl();
+ parser.setDocumentHandler(handler);
+ parser.parseStyleSheet(getClass().getResource(scss).getPath());
+ ScssStylesheet root = handler.getStyleSheet();
+ Assert.assertEquals(4, root.getChildren().size());
+ }
+
+ @Test
+ public void testCompiler() throws Exception {
+ testCompiler(scss, css);
+ Assert.assertEquals("Original CSS and parsed CSS doesn't match",
+ comparisonCss, parsedScss);
+ }
+}