From: Goal Smashers Dev Team Date: Sat, 9 Feb 2013 09:42:07 +0000 (+0100) Subject: Fixes #60 - tests broken on Windows. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=dd2e2ca96f333b5ded7f9abb518ecf7e4c4973e4;p=clean-css.git Fixes #60 - tests broken on Windows. --- diff --git a/lib/clean.js b/lib/clean.js index 0efcb9ba..464b3e82 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -269,7 +269,7 @@ var CleanCSS = { // reattach first charset if (firstCharset !== '') { - data = firstCharset + (options.keepBreaks ? '\n': '') + data; + data = firstCharset + (options.keepBreaks ? lineBreak : '') + data; } }); diff --git a/test/unit-test.js b/test/unit-test.js index 6acc3655..45c76c37 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -126,8 +126,8 @@ vows.describe('clean-units').addBatch({ 'in content preceded by #content': '#content{}#foo{content:"\00BB "}', 'in content preceded by .content': '.content{}#foo{content:"\00BB "}', 'in content preceded by line break': [ - '.content{}#foo{' + lineBreak + 'content:"\00BB "}', - '.content{}#foo{content:"\00BB "}' + '.content{}#foo{' + lineBreak + 'content:"x"}', + '.content{}#foo{content:"x"}' ] }), 'line breaks': cssContext({ @@ -149,11 +149,11 @@ vows.describe('clean-units').addBatch({ ], 'charset not at beginning': [ "a{ color: #f10; }\n@charset 'utf-8';\nb { font-weight: bolder}", - "@charset 'utf-8';\na{color:#f10}\nb{font-weight:bolder}" + "@charset 'utf-8';" + lineBreak + "a{color:#f10}" + lineBreak + "b{font-weight:bolder}" ], 'charset multiple charsets': [ "@charset 'utf-8';\ndiv :before { display: block }\n@charset 'utf-8';\na { color: #f10 }", - "@charset 'utf-8';\ndiv :before{display:block}\na{color:#f10}" + "@charset 'utf-8';" + lineBreak + "div :before{display:block}" + lineBreak + "a{color:#f10}" ] }, { keepBreaks: true }), 'selectors': cssContext({