summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaijiro Wachi <daijiro.wachi@gmail.com>2020-10-25 21:49:13 +0900
committerDaijiro Wachi <daijiro.wachi@gmail.com>2020-10-28 00:25:51 +0900
commitbec918fb9bbf3fa1d8f9f5fcd37a9ee5f719dd63 (patch)
tree668b7e2b0565c057a9d61ef6de5ef271f5769a3a
parentf20a783a31a004d58d1a7440fa270b01508e82f9 (diff)
downloadnode-new-bec918fb9bbf3fa1d8f9f5fcd37a9ee5f719dd63.tar.gz
test: add upstream test cases to encoding
Refs: https://github.com/web-platform-tests/wpt/pull/25988 Refs: https://github.com/web-platform-tests/wpt/pull/26158 PR-URL: https://github.com/nodejs/node/pull/35794 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--test/fixtures/wpt/README.md2
-rw-r--r--test/fixtures/wpt/encoding/iso-2022-jp-encoder.html14
-rw-r--r--test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js6
-rw-r--r--test/fixtures/wpt/versions.json2
4 files changed, 19 insertions, 5 deletions
diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md
index dc1a561561..e0880c0efd 100644
--- a/test/fixtures/wpt/README.md
+++ b/test/fixtures/wpt/README.md
@@ -11,7 +11,7 @@ See [test/wpt](../../wpt/README.md) for information on how these tests are run.
Last update:
- console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console
-- encoding: https://github.com/web-platform-tests/wpt/tree/d7f9e16c9a/encoding
+- encoding: https://github.com/web-platform-tests/wpt/tree/1821fb5f77/encoding
- url: https://github.com/web-platform-tests/wpt/tree/54c6d64be0/url
- resources: https://github.com/web-platform-tests/wpt/tree/1d14e821b9/resources
- interfaces: https://github.com/web-platform-tests/wpt/tree/15e47f779c/interfaces
diff --git a/test/fixtures/wpt/encoding/iso-2022-jp-encoder.html b/test/fixtures/wpt/encoding/iso-2022-jp-encoder.html
index 81bd18039b..fa08375d9e 100644
--- a/test/fixtures/wpt/encoding/iso-2022-jp-encoder.html
+++ b/test/fixtures/wpt/encoding/iso-2022-jp-encoder.html
@@ -12,8 +12,16 @@
}, "iso-2022-jp encoder: " + desc)
}
- encode("s", "s", "very basic")
- encode("\u00A5\u203Es\\\uFF90\u4F69", "%1B(J\\~s%1B(B\\%1B$B%_PP%1B(B", "basics")
- encode("\x0E\x0F\x1Bx", "%0E%0F%1Bx", "SO/SI ESC")
+ encode("s", "s", "very basic");
+ encode("\u00A5\u203Es\\\uFF90\u4F69", "%1B(J\\~s%1B(B\\%1B$B%_PP%1B(B", "basics");
+ encode("\uFF61", "%1B$B!%23%1B(B", "Katakana");
+ encode("\u0393", "%1B$B&%23%1B(B", "jis0208");
+ encode("\x0E\x0F\x1Bx", "%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "SO/SI ESC");
+ encode("\u203E\x0E\x0F\x1Bx", "%1B(J~%26%2365533%3B%26%2365533%3B%26%2365533%3Bx%1B(B", "Roman SO/SI ESC");
+ encode("\uFF61\x0E\x0F\x1Bx", "%1B$B!%23%1B(B%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "Katakana SO/SI ESC");
+ encode("\u0393\x0E\x0F\x1Bx", "%1B$B&%23%1B(B%26%2365533%3B%26%2365533%3B%26%2365533%3Bx", "jis0208 SO/SI ESC");
encode("\uFFFD", "%26%2365533%3B", "U+FFFD");
+ encode("\u203E\uFFFD", "%1B(J~%26%2365533%3B%1B(B", "Roman U+FFFD");
+ encode("\uFF61\uFFFD", "%1B$B!%23%1B(B%26%2365533%3B", "Katakana U+FFFD");
+ encode("\u0393\uFFFD", "%1B$B&%23%1B(B%26%2365533%3B", "jis0208 U+FFFD");
</script>
diff --git a/test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js b/test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js
index a7f8ec11c9..2950a9e58e 100644
--- a/test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js
+++ b/test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js
@@ -26,6 +26,12 @@ const encodings = [
invalid: [255]
},
{
+ name: 'ISO-2022-JP',
+ value: [65, 66, 67, 0x1B, 65, 66, 67],
+ expected: "ABC\u{fffd}ABC",
+ invalid: [0x0E]
+ },
+ {
name: 'ISO-8859-14',
value: [100, 240, 114],
expected: "d\u{0175}r",
diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json
index 77e19285d9..49a6b702ba 100644
--- a/test/fixtures/wpt/versions.json
+++ b/test/fixtures/wpt/versions.json
@@ -4,7 +4,7 @@
"path": "console"
},
"encoding": {
- "commit": "d7f9e16c9a9d578a05b59787ba4de68b710de725",
+ "commit": "1821fb5f77723b5361058c6a8ed0b71f9d2d6b8d",
"path": "encoding"
},
"url": {