MCPcopy Create free account
hub / github.com/nodejs/node / decode

Function decode

test/fixtures/wpt/encoding/iso-2022-jp-decoder.any.js:3–13  ·  view source on GitHub ↗
(input, output, desc)

Source from the content-addressed store, hash-verified

1// META: global=window,dedicatedworker,shadowrealm
2//
3function decode(input, output, desc) {
4 test(function() {
5 var d = new TextDecoder("iso-2022-jp"),
6 buffer = new ArrayBuffer(input.length),
7 view = new Int8Array(buffer)
8 for(var i = 0, l = input.length; i < l; i++) {
9 view[i] = input[i]
10 }
11 assert_equals(d.decode(view), output)
12 }, "iso-2022-jp decoder: " + desc)
13}
14decode([0x1b, 0x24], "�$", "Error ESC")
15decode([0x1b, 0x24, 0x50], "�$P", "Error ESC, character")
16decode([0x1b, 0x28, 0x42, 0x50], "P", "ASCII ESC, character")

Callers 1

Calls 3

decodeMethod · 0.95
testFunction · 0.50
assert_equalsFunction · 0.50

Tested by

no test coverage detected