summaryrefslogtreecommitdiffstats
path: root/theme-compiler/tests
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-04-23 14:54:48 +0300
committerArtur Signell <artur@vaadin.com>2013-04-23 14:54:48 +0300
commited79188e0dd8876496c9848ca40479256e08c6c3 (patch)
tree53ec00a284329cdf68d413cfa2c65bbb9a40e3eb /theme-compiler/tests
parent53b5766731b678694ee83ce8dd3592185ba36105 (diff)
parentfeb9a8c3510afc76c079fafcd9e507205bde139c (diff)
downloadvaadin-framework-ed79188e0dd8876496c9848ca40479256e08c6c3.tar.gz
vaadin-framework-ed79188e0dd8876496c9848ca40479256e08c6c3.zip
Merge commit 'feb9a8c3510afc76c079fafcd9e507205bde139c'
Conflicts: WebContent/release-notes.html theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java Change-Id: Iad9ee95b2f399ff93f0e426a0810b18d923f8ff6
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.java11
5 files changed, 42 insertions, 3 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 d60756a2c9..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
@@ -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;