OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 // Test from https://github.com/mathiasbynens/CSS.escape | 8 // Test from https://github.com/mathiasbynens/CSS.escape |
9 description("Test window.CSS.escape()"); | 9 description("Test window.CSS.escape()"); |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 shouldBeEqualToString("CSS.escape('-1a')", "-\\31 a"); | 47 shouldBeEqualToString("CSS.escape('-1a')", "-\\31 a"); |
48 shouldBeEqualToString("CSS.escape('-2a')", "-\\32 a"); | 48 shouldBeEqualToString("CSS.escape('-2a')", "-\\32 a"); |
49 shouldBeEqualToString("CSS.escape('-3a')", "-\\33 a"); | 49 shouldBeEqualToString("CSS.escape('-3a')", "-\\33 a"); |
50 shouldBeEqualToString("CSS.escape('-4a')", "-\\34 a"); | 50 shouldBeEqualToString("CSS.escape('-4a')", "-\\34 a"); |
51 shouldBeEqualToString("CSS.escape('-5a')", "-\\35 a"); | 51 shouldBeEqualToString("CSS.escape('-5a')", "-\\35 a"); |
52 shouldBeEqualToString("CSS.escape('-6a')", "-\\36 a"); | 52 shouldBeEqualToString("CSS.escape('-6a')", "-\\36 a"); |
53 shouldBeEqualToString("CSS.escape('-7a')", "-\\37 a"); | 53 shouldBeEqualToString("CSS.escape('-7a')", "-\\37 a"); |
54 shouldBeEqualToString("CSS.escape('-8a')", "-\\38 a"); | 54 shouldBeEqualToString("CSS.escape('-8a')", "-\\38 a"); |
55 shouldBeEqualToString("CSS.escape('-9a')", "-\\39 a"); | 55 shouldBeEqualToString("CSS.escape('-9a')", "-\\39 a"); |
56 | 56 |
57 shouldBeEqualToString("CSS.escape('-')", "\\-"); | |
mathias
2015/09/10 10:13:04
To match the updated source tests, add this:
| |
58 shouldBeEqualToString("CSS.escape('--')", "--"); | |
mathias
2015/09/10 10:20:25
This test expectation is incorrect. It should be `
| |
57 shouldBeEqualToString("CSS.escape('--a')", "--a"); | 59 shouldBeEqualToString("CSS.escape('--a')", "--a"); |
58 | 60 |
59 shouldBeEqualToString("CSS.escape('\x80\x2D\x5F\xA9')", "\x80\x2D\x5F\xA9"); | 61 shouldBeEqualToString("CSS.escape('\x80\x2D\x5F\xA9')", "\x80\x2D\x5F\xA9"); |
60 shouldBeEqualToString("CSS.escape('\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\ x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\ x9D\x9E\x9F')", "\\7f \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x 8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"); | 62 shouldBeEqualToString("CSS.escape('\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\ x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\ x9D\x9E\x9F')", "\\7f \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x 8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"); |
61 shouldBeEqualToString("CSS.escape('\xA0\xA1\xA2')", "\xA0\xA1\xA2"); | 63 shouldBeEqualToString("CSS.escape('\xA0\xA1\xA2')", "\xA0\xA1\xA2"); |
62 shouldBeEqualToString("CSS.escape('a0123456789b')", "a0123456789b"); | 64 shouldBeEqualToString("CSS.escape('a0123456789b')", "a0123456789b"); |
63 shouldBeEqualToString("CSS.escape('abcdefghijklmnopqrstuvwxyz')", "abcdefghi jklmnopqrstuvwxyz"); | 65 shouldBeEqualToString("CSS.escape('abcdefghijklmnopqrstuvwxyz')", "abcdefghi jklmnopqrstuvwxyz"); |
64 shouldBeEqualToString("CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ')", "ABCDEFGHI JKLMNOPQRSTUVWXYZ"); | 66 shouldBeEqualToString("CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ')", "ABCDEFGHI JKLMNOPQRSTUVWXYZ"); |
65 | 67 |
66 shouldBeEqualToString("CSS.escape('\x20\x21\x78\x79')", "\\ \\!xy"); | 68 shouldBeEqualToString("CSS.escape('\x20\x21\x78\x79')", "\\ \\!xy"); |
67 | 69 |
68 // astral symbol (U+1D306 TETRAGRAM FOR CENTRE) | 70 // astral symbol (U+1D306 TETRAGRAM FOR CENTRE) |
69 shouldBeEqualToString("CSS.escape('\uD834\uDF06')", "\uD834\uDF06"); | 71 shouldBeEqualToString("CSS.escape('\uD834\uDF06')", "\uD834\uDF06"); |
70 // lone surrogates | 72 // lone surrogates |
71 shouldBeEqualToString("CSS.escape('\uDF06')", '\uDF06'); | 73 shouldBeEqualToString("CSS.escape('\uDF06')", '\uDF06'); |
72 shouldBeEqualToString("CSS.escape('\uD834')", '\uD834'); | 74 shouldBeEqualToString("CSS.escape('\uD834')", '\uD834'); |
73 </script> | 75 </script> |
74 </body> | 76 </body> |
75 </html> | 77 </html> |
OLD | NEW |