Fixes #60 - tests broken on Windows.
authorGoal Smashers Dev Team <jakub@goalsmasher.com>
Sat, 9 Feb 2013 09:42:07 +0000 (10:42 +0100)
committerGoal Smashers Dev Team <jakub@goalsmasher.com>
Sat, 9 Feb 2013 09:42:07 +0000 (10:42 +0100)
lib/clean.js
test/unit-test.js

index 0efcb9b..464b3e8 100644 (file)
@@ -269,7 +269,7 @@ var CleanCSS = {
 
       // reattach first charset
       if (firstCharset !== '') {
-        data = firstCharset + (options.keepBreaks ? '\n': '') + data;
+        data = firstCharset + (options.keepBreaks ? lineBreak : '') + data;
       }
     });
 
index 6acc365..45c76c3 100644 (file)
@@ -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({