Skip to content

Commit dd3cbb4

Browse files
watildetargos
authored andcommitted
test: add upstream test cases to encoding
Refs: web-platform-tests/wpt#25988 Refs: web-platform-tests/wpt#26158 PR-URL: #35794 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f08e2c0 commit dd3cbb4

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

test/fixtures/wpt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See [test/wpt](../../wpt/README.md) for information on how these tests are run.
1111
Last update:
1212

1313
- console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console
14-
- encoding: https://github.com/web-platform-tests/wpt/tree/d7f9e16c9a/encoding
14+
- encoding: https://github.com/web-platform-tests/wpt/tree/1821fb5f77/encoding
1515
- url: https://github.com/web-platform-tests/wpt/tree/54c6d64be0/url
1616
- resources: https://github.com/web-platform-tests/wpt/tree/1d14e821b9/resources
1717
- interfaces: https://github.com/web-platform-tests/wpt/tree/15e47f779c/interfaces

test/fixtures/wpt/encoding/iso-2022-jp-encoder.html

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@
1212
}, "iso-2022-jp encoder: " + desc)
1313
}
1414

15-
encode("s", "s", "very basic")
16-
encode("\u00A5\u203Es\\\uFF90\u4F69", "%1B(J\\~s%1B(B\\%1B$B%_PP%1B(B", "basics")
17-
encode("\x0E\x0F\x1Bx", "%0E%0F%1Bx", "SO/SI ESC")
15+
encode("s", "s", "very basic");
16+
encode("\u00A5\u203Es\\\uFF90\u4F69", "%1B(J\\~s%1B(B\\%1B$B%_PP%1B(B", "basics");
17+
encode("\uFF61", "%1B$B!%23%1B(B", "Katakana");
18+
encode("\u0393", "%1B$B&%23%1B(B", "jis0208");
19+
encode("\x0E\x0F\x1Bx", "%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "SO/SI ESC");
20+
encode("\u203E\x0E\x0F\x1Bx", "%1B(J~%26%2365533%3B%26%2365533%3B%26%2365533%3Bx%1B(B", "Roman SO/SI ESC");
21+
encode("\uFF61\x0E\x0F\x1Bx", "%1B$B!%23%1B(B%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "Katakana SO/SI ESC");
22+
encode("\u0393\x0E\x0F\x1Bx", "%1B$B&%23%1B(B%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "jis0208 SO/SI ESC");
1823
encode("\uFFFD", "%26%2365533%3B", "U+FFFD");
24+
encode("\u203E\uFFFD", "%1B(J~%26%2365533%3B%1B(B", "Roman U+FFFD");
25+
encode("\uFF61\uFFFD", "%1B$B!%23%1B(B%26%2365533%3B", "Katakana U+FFFD");
26+
encode("\u0393\uFFFD", "%1B$B&%23%1B(B%26%2365533%3B", "jis0208 U+FFFD");
1927
</script>

test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const encodings = [
2525
expected: "\u{6c34}",
2626
invalid: [255]
2727
},
28+
{
29+
name: 'ISO-2022-JP',
30+
value: [65, 66, 67, 0x1B, 65, 66, 67],
31+
expected: "ABC\u{fffd}ABC",
32+
invalid: [0x0E]
33+
},
2834
{
2935
name: 'ISO-8859-14',
3036
value: [100, 240, 114],

test/fixtures/wpt/versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"path": "console"
55
},
66
"encoding": {
7-
"commit": "d7f9e16c9a9d578a05b59787ba4de68b710de725",
7+
"commit": "1821fb5f77723b5361058c6a8ed0b71f9d2d6b8d",
88
"path": "encoding"
99
},
1010
"url": {

0 commit comments

Comments
 (0)