summaryrefslogtreecommitdiffstats
path: root/theme-compiler/tests
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2013-04-18 10:36:31 +0300
committerVaadin Code Review <review@vaadin.com>2013-04-18 17:54:58 +0000
commit0a2b6b5127f97bededd4b84926d656b9dd4a3032 (patch)
tree54ed232c9dc9679c2ab6f43c0e57d6d26b93e932 /theme-compiler/tests
parent4f9df1f6f0926cfce846a43c557e9b69302a4ca3 (diff)
downloadvaadin-framework-0a2b6b5127f97bededd4b84926d656b9dd4a3032.tar.gz
vaadin-framework-0a2b6b5127f97bededd4b84926d656b9dd4a3032.zip
Support "to" in CSS function parameters (#11309)
This change also relaxes whitespace checking in SCSS tests slightly. Change-Id: I2ad5087e7d77ddd0473df47d202c6dd3e228181f
Diffstat (limited to 'theme-compiler/tests')
-rw-r--r--theme-compiler/tests/resources/automatic/css/gradient.css17
-rw-r--r--theme-compiler/tests/resources/automatic/scss/gradient.scss17
-rw-r--r--theme-compiler/tests/resources/sasslang/css/385-test_newlines_removed_from_selectors_when_compressed.css (renamed from theme-compiler/tests/resources/sasslangbroken/css/385-test_newlines_removed_from_selectors_when_compressed.css)0
-rw-r--r--theme-compiler/tests/resources/sasslang/scss/385-test_newlines_removed_from_selectors_when_compressed.scss (renamed from theme-compiler/tests/resources/sasslangbroken/scss/385-test_newlines_removed_from_selectors_when_compressed.scss)0
-rw-r--r--theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java13
5 files changed, 43 insertions, 4 deletions
diff --git a/theme-compiler/tests/resources/automatic/css/gradient.css b/theme-compiler/tests/resources/automatic/css/gradient.css
new file mode 100644
index 0000000000..c304d5fc36
--- /dev/null
+++ b/theme-compiler/tests/resources/automatic/css/gradient.css
@@ -0,0 +1,17 @@
+ .top-gradient {
+ background: -moz-linear-gradient(
+ top,
+ rgb(216,220,225) 0,
+ rgb(255,255,255) 1em,
+ rgb(255,255,255) 100%);
+ background: -webkit-linear-gradient(
+ top,
+ rgb(216,220,225) 0,
+ rgb(255,255,255) 1em,
+ rgb(255,255,255) 100%);
+ background: linear-gradient(
+ to bottom,
+ rgb(216,220,225) 0%,
+ rgb(255,255,255) 5%,
+ rgb(255,255,255) 100%);
+ } \ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/scss/gradient.scss b/theme-compiler/tests/resources/automatic/scss/gradient.scss
new file mode 100644
index 0000000000..c304d5fc36
--- /dev/null
+++ b/theme-compiler/tests/resources/automatic/scss/gradient.scss
@@ -0,0 +1,17 @@
+ .top-gradient {
+ background: -moz-linear-gradient(
+ top,
+ rgb(216,220,225) 0,
+ rgb(255,255,255) 1em,
+ rgb(255,255,255) 100%);
+ background: -webkit-linear-gradient(
+ top,
+ rgb(216,220,225) 0,
+ rgb(255,255,255) 1em,
+ rgb(255,255,255) 100%);
+ background: linear-gradient(
+ to bottom,
+ rgb(216,220,225) 0%,
+ rgb(255,255,255) 5%,
+ rgb(255,255,255) 100%);
+ } \ No newline at end of file
diff --git a/theme-compiler/tests/resources/sasslangbroken/css/385-test_newlines_removed_from_selectors_when_compressed.css b/theme-compiler/tests/resources/sasslang/css/385-test_newlines_removed_from_selectors_when_compressed.css
index 5032ec877d..5032ec877d 100644
--- a/theme-compiler/tests/resources/sasslangbroken/css/385-test_newlines_removed_from_selectors_when_compressed.css
+++ b/theme-compiler/tests/resources/sasslang/css/385-test_newlines_removed_from_selectors_when_compressed.css
diff --git a/theme-compiler/tests/resources/sasslangbroken/scss/385-test_newlines_removed_from_selectors_when_compressed.scss b/theme-compiler/tests/resources/sasslang/scss/385-test_newlines_removed_from_selectors_when_compressed.scss
index c04a1ee63a..c04a1ee63a 100644
--- a/theme-compiler/tests/resources/sasslangbroken/scss/385-test_newlines_removed_from_selectors_when_compressed.scss
+++ b/theme-compiler/tests/resources/sasslang/scss/385-test_newlines_removed_from_selectors_when_compressed.scss
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java
index 47657f805c..40da6179f6 100644
--- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java
+++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java
@@ -33,7 +33,7 @@ import org.junit.Assert;
import com.vaadin.sass.internal.ScssStylesheet;
import com.vaadin.sass.testcases.scss.SassTestRunner.FactoryTest;
-public abstract class AbstractDirectoryScanningSassTests {
+public abstract class AbstractDirectoryScanningSassTests {
public static Collection<String> getScssResourceNames(URL directoryUrl)
throws URISyntaxException {
@@ -73,14 +73,19 @@ public abstract class AbstractDirectoryScanningSassTests {
scssStylesheet.compile();
String parsedCss = scssStylesheet.toString();
+ String normalizedReference = normalize(referenceCss);
+ String normalizedParsed = normalize(parsedCss);
Assert.assertEquals("Original CSS and parsed CSS do not match for "
- + scssResourceName, normalize(referenceCss),
- normalize(parsedCss));
+ + scssResourceName, normalizedReference, normalizedParsed);
}
private String normalize(String css) {
- // Replace all whitespace characters with a single space
+ // Insert whitespace at each point
css = css.replaceAll("[\n\r\t ]*", " ");
+ // Replace multiple whitespace characters with a single space to compact
+ css = css.replaceAll("[\n\r\t ]+", " ");
+ // remove initial whitespace
+ css = css.replaceAll("^[\n\r\t ]*", "");
// remove trailing whitespace
css = css.replaceAll("[\n\r\t ]*$", "");
return css;