diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-01-05 19:50:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 19:50:40 +0100 |
commit | 0d41e21b0e9b46cc179eff42c215439fb672964b (patch) | |
tree | ec61f2e543de43f3633bcab17a4eb0fdb34aab06 /op_crates/web/text_encoding_test.js | |
parent | ee9c0c837331528653f959d57f094a8dbfdaacce (diff) |
fix: align encoding APIs to spec using WPT (#9004)
Diffstat (limited to 'op_crates/web/text_encoding_test.js')
-rw-r--r-- | op_crates/web/text_encoding_test.js | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/op_crates/web/text_encoding_test.js b/op_crates/web/text_encoding_test.js index 9a4bb492b..35fe6a212 100644 --- a/op_crates/web/text_encoding_test.js +++ b/op_crates/web/text_encoding_test.js @@ -100,59 +100,7 @@ function textDecoder2() { assert(decoder.decode(fixture) === "𝓽𝓮𝔁𝓽"); } -function textDecoderIgnoreBOM() { - // deno-fmt-ignore - const fixture = new Uint8Array([ - 0xef, - 0xbb, - 0xbf, - 0xf0, - 0x9d, - 0x93, - 0xbd, - 0xf0, - 0x9d, - 0x93, - 0xae, - 0xf0, - 0x9d, - 0x94, - 0x81, - 0xf0, - 0x9d, - 0x93, - 0xbd, - ]); - const decoder = new TextDecoder("utf-8", { ignoreBOM: true }); - assert(decoder.decode(fixture) === "𝓽𝓮𝔁𝓽"); -} - -function textDecoderNotBOM() { - // deno-fmt-ignore - const fixture = new Uint8Array([ - 0xef, - 0xbb, - 0x89, - 0xf0, - 0x9d, - 0x93, - 0xbd, - 0xf0, - 0x9d, - 0x93, - 0xae, - 0xf0, - 0x9d, - 0x94, - 0x81, - 0xf0, - 0x9d, - 0x93, - 0xbd, - ]); - const decoder = new TextDecoder("utf-8", { ignoreBOM: true }); - assert(decoder.decode(fixture) === "ﻉ𝓽𝓮𝔁𝓽"); -} +// ignoreBOM is tested by WPT function textDecoderASCII() { const fixture = new Uint8Array([0x89, 0x95, 0x9f, 0xbf]); @@ -1252,8 +1200,6 @@ function main() { atobThrows2(); btoaFailed(); textDecoder2(); - textDecoderIgnoreBOM(); - textDecoderNotBOM(); textDecoderASCII(); textDecoderErrorEncoding(); textDecoderHandlesUndefined(); |