Skip to content

Commit 6ee2fc6

Browse files
evilebottnawimichael-ciniawsky
authored andcommitted
test: add test for escaped characters (#493)
1 parent bff9c7f commit 6ee2fc6

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

test/simpleTest.js

+22-11
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,29 @@ describe("simple", function() {
1818
test("simple2", ".class { a: b c d; }\n.two {}", [
1919
[1, ".class { a: b c d; }\n.two {}", ""]
2020
]);
21+
test("escape characters (uppercase)", ".class { content: \"\\F10C\" }", [
22+
[1, ".class { content: \"\\F10C\" }", ""]
23+
]);
24+
// Need uncomment after resolve https://github.com/css-modules/postcss-modules-local-by-default/issues/108
25+
/*test("escape characters (lowercase)", ".class { content: \"\\f10C\" }", [
26+
[1, ".class { content: \"\\f10C\" }", ""]
27+
]);*/
28+
// Need uncomment after resolve https://github.com/mathiasbynens/cssesc/issues/10
29+
/*test("escape characters (two)", ".class { content: \"\\F10C \\F10D\" }", [
30+
[1, ".class { content: \"\\F10C \\F10D\" }", ""]
31+
]);*/
2132
testMinimize("minimized simple", ".class { a: b c d; }", [
2233
[1, ".class{a:b c d}", ""]
2334
]);
24-
testError("error formatting", ".some {\n invalid css;\n}", function(err) {
25-
assert.equal(err.message, [
26-
'Unknown word (2:2)',
27-
'',
28-
' 1 | .some {',
29-
'> 2 | invalid css;',
30-
' | ^',
31-
' 3 | }',
32-
'',
33-
].join('\n'));
34-
});
35+
testError("error formatting", ".some {\n invalid css;\n}", function(err) {
36+
assert.equal(err.message, [
37+
'Unknown word (2:2)',
38+
'',
39+
' 1 | .some {',
40+
'> 2 | invalid css;',
41+
' | ^',
42+
' 3 | }',
43+
'',
44+
].join('\n'));
45+
});
3546
});

0 commit comments

Comments
 (0)