Skip to content

Commit

Permalink
test: add upstream test cases to encoding
Browse files Browse the repository at this point in the history
Refs: web-platform-tests/wpt#25988
Refs: web-platform-tests/wpt#26158

PR-URL: #35794
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
watilde authored and BethGriggs committed Dec 15, 2020
1 parent 8ef4557 commit 0aba122
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/9786a4b131/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/418f7fabeb/url
- resources: https://github.com/web-platform-tests/wpt/tree/e1fddfbf80/resources
- interfaces: https://github.com/web-platform-tests/wpt/tree/8ada332aea/interfaces
Expand Down
14 changes: 11 additions & 3 deletions test/fixtures/wpt/encoding/iso-2022-jp-encoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
6 changes: 6 additions & 0 deletions test/fixtures/wpt/encoding/streams/decode-non-utf8.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const encodings = [
expected: "\u{6c34}",
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],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"path": "console"
},
"encoding": {
"commit": "d7f9e16c9a9d578a05b59787ba4de68b710de725",
"commit": "1821fb5f77723b5361058c6a8ed0b71f9d2d6b8d",
"path": "encoding"
},
"url": {
Expand Down

0 comments on commit 0aba122

Please sign in to comment.