From a5727e440003270ebf54f9f55abf5156143a580c Mon Sep 17 00:00:00 2001 From: denisanisimov Date: Mon, 13 Jan 2014 10:24:58 +0200 Subject: [PATCH] Some tests are fixed on Win (CRLF issue). Change-Id: I057bae0fd4068c6b877abdb9546ebf1490339d86 --- .../tests/src/com/vaadin/sass/AbstractTestBase.java | 6 ++++++ .../src/com/vaadin/sass/testcases/scss/CompassImports.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java b/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java index d867e6ccd0..01187b4502 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java +++ b/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java @@ -30,6 +30,8 @@ import com.vaadin.sass.internal.ScssStylesheet; public abstract class AbstractTestBase { + public static final String CR = "\r"; + protected ScssStylesheet stylesheet; protected String originalScss; protected String parsedScss; @@ -69,17 +71,21 @@ public abstract class AbstractTestBase { public void testParser(String file) throws CSSException, IOException, URISyntaxException { originalScss = getFileContent(file); + originalScss = originalScss.replaceAll(CR, ""); ScssStylesheet sheet = getStyleSheet(file); parsedScss = sheet.toString(); + parsedScss = parsedScss.replace(CR, ""); Assert.assertEquals("Original CSS and parsed CSS do not match", originalScss, parsedScss); } public void testCompiler(String scss, String css) throws Exception { comparisonCss = getFileContent(css); + comparisonCss = comparisonCss.replaceAll(CR, ""); ScssStylesheet sheet = getStyleSheet(scss); sheet.compile(); parsedScss = sheet.toString(); + parsedScss = parsedScss.replaceAll(CR, ""); Assert.assertEquals("Original CSS and parsed CSS do not match", comparisonCss, parsedScss); } diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java index 1e3eb09f0c..4e87eb2197 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java @@ -68,12 +68,14 @@ public class CompassImports extends AbstractTestBase { public void testCompiler(String scss, String css, String additionalPath) throws Exception { comparisonCss = getFileContent(css); + comparisonCss = comparisonCss.replaceAll(CR, ""); ScssStylesheet sheet = getStyleSheet(scss); Assert.assertNotNull(sheet); sheet.addResolver(new FilesystemResolver(additionalPath)); sheet.compile(); parsedScss = sheet.toString(); + parsedScss = parsedScss.replaceAll(CR, ""); Assert.assertEquals("Original CSS and parsed CSS do not match", comparisonCss, parsedScss); } -- 2.39.5