Skip to content

Commit 9222e8e

Browse files
author
evilebottnawi
committed
fix: utf-8 characters support, emoji also 😸.
1 parent 1fee601 commit 9222e8e

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

‎test/importTest.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,30 @@ describe("import", function() {
99
], "", {
1010
"./test.css": [[2, ".test{a: b}", ""]]
1111
});
12+
test("import 2", "@import url('test.css');\n.class { a: b c d; }", [
13+
[2, ".test{a: b}", "screen"],
14+
[1, ".class { a: b c d; }", ""]
15+
], "", {
16+
"./test.css": [[2, ".test{a: b}", "screen"]]
17+
});
18+
test("import non ascii characters (emoji)", "@import url(😸.css);\n.class { a: b c d; }", [
19+
[2, ".test{a: b}", ""],
20+
[1, ".class { a: b c d; }", ""]
21+
], "", {
22+
"./😸.css": [[2, ".test{a: b}", ""]]
23+
});
1224
test("import camelcase", "@IMPORT url(test.css);\n.class { a: b c d; }", [
1325
[2, ".test{a: b}", ""],
1426
[1, ".class { a: b c d; }", ""]
1527
], "", {
1628
"./test.css": [[2, ".test{a: b}", ""]]
1729
});
18-
test("import empty url", "@import url();\n.class { a: b c d; }", [
19-
[1, "@import url();\n.class { a: b c d; }", ""]
20-
], "");
21-
test("import empty url with quotes", "@import url('');\n.class { a: b c d; }", [
22-
[1, "@import url('');\n.class { a: b c d; }", ""]
23-
], "");
30+
test("import empty url", "@import url();\n.class { a: b c d; }", [
31+
[1, "@import url();\n.class { a: b c d; }", ""]
32+
], "");
33+
test("import empty url with quotes", "@import url('');\n.class { a: b c d; }", [
34+
[1, "@import url('');\n.class { a: b c d; }", ""]
35+
], "");
2436
test("import with string", "@import \"test.css\";\n.class { a: b c d; }", [
2537
[2, ".test{a: b}", ""],
2638
[1, ".class { a: b c d; }", ""]

‎test/simpleTest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ describe("simple", function() {
2929
/*test("escape characters (two)", ".class { content: \"\\F10C \\F10D\" }", [
3030
[1, ".class { content: \"\\F10C \\F10D\" }", ""]
3131
]);*/
32+
test("non-ascii characters", "body { font-family: '😸'; }", [
33+
[1, "body { font-family: '😸'; }", ""]
34+
]);
3235
testMinimize("minimized simple", ".class { a: b c d; }", [
3336
[1, ".class{a:b c d}", ""]
3437
]);

0 commit comments

Comments
 (0)