GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: update WPT encoding tests · nodejs/node@198cf59

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • fixtures/wpt
      • README.md
      • encoding
        • encodeInto.any.js.headers
        • encodeInto.any.js
        • idlharness-shadowrealm.window.js
        • sharedarraybuffer.https.html.headers
        • sharedarraybuffer.https.html
        • single-byte-decoder.window.js
        • streams
          • decode-utf8.any.js.headers
          • decode-utf8.any.js
        • textdecoder-copy.any.js.headers
        • textdecoder-eof.any.js
        • textdecoder-streaming.any.js.headers
        • textdecoder-streaming.any.js
      • versions.json
    • wpt/status
      • encoding.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/fixtures/wpt/README.md‎

Copy file name to clipboardExpand all lines: test/fixtures/wpt/README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Last update:
1414
- console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console
1515
- dom/abort: https://github.com/web-platform-tests/wpt/tree/c49cafb491/dom/abort
1616
- dom/events: https://github.com/web-platform-tests/wpt/tree/f8821adb28/dom/events
17-
- encoding: https://github.com/web-platform-tests/wpt/tree/35f70910d3/encoding
17+
- encoding: https://github.com/web-platform-tests/wpt/tree/c1b24fce6e/encoding
1818
- FileAPI: https://github.com/web-platform-tests/wpt/tree/3b279420d4/FileAPI
1919
- hr-time: https://github.com/web-platform-tests/wpt/tree/9910784394/hr-time
2020
- html/webappapis/atob: https://github.com/web-platform-tests/wpt/tree/f267e1dca6/html/webappapis/atob
Collapse file

‎test/fixtures/wpt/encoding/encodeInto.any.js‎

Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/encodeInto.any.js
+14-11Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,22 @@
120120
});
121121
});
122122

123-
[DataView,
124-
Int8Array,
125-
Int16Array,
126-
Int32Array,
127-
Uint16Array,
128-
Uint32Array,
129-
Uint8ClampedArray,
130-
Float32Array,
131-
Float64Array].forEach(view => {
123+
["DataView",
124+
"Int8Array",
125+
"Int16Array",
126+
"Int32Array",
127+
"Uint16Array",
128+
"Uint32Array",
129+
"Uint8ClampedArray",
130+
"BigInt64Array",
131+
"BigUint64Array",
132+
"Float32Array",
133+
"Float64Array"].forEach(type => {
132134
["ArrayBuffer", "SharedArrayBuffer"].forEach((arrayBufferOrSharedArrayBuffer) => {
133135
test(() => {
134-
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", new view(createBuffer(arrayBufferOrSharedArrayBuffer, 0))));
135-
}, "Invalid encodeInto() destination: " + view.name + ", backed by: " + arrayBufferOrSharedArrayBuffer);
136+
const viewInstance = new self[type](createBuffer(arrayBufferOrSharedArrayBuffer, 0));
137+
assert_throws_js(TypeError, () => new TextEncoder().encodeInto("", viewInstance));
138+
}, "Invalid encodeInto() destination: " + type + ", backed by: " + arrayBufferOrSharedArrayBuffer);
136139
});
137140
});
138141

Collapse file

‎test/fixtures/wpt/encoding/encodeInto.any.js.headers‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cross-Origin-Opener-Policy: same-origin
2+
Cross-Origin-Embedder-Policy: require-corp
Collapse file

‎test/fixtures/wpt/encoding/idlharness-shadowrealm.window.js‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// META: script=/resources/idlharness-shadowrealm.js
2+
idl_test_shadowrealm(["encoding"], ["streams"]);
Collapse file

‎test/fixtures/wpt/encoding/sharedarraybuffer.https.html‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<script src="/resources/testharness.js"></script>
3+
<script src="/resources/testharnessreport.js"></script>
4+
<script>
5+
6+
test(() => {
7+
const decoder = new TextDecoder('utf-8');
8+
const buffer = new SharedArrayBuffer(4);
9+
assert_throws_js(TypeError, () => {
10+
decoder.decode(new Uint8Array(buffer));
11+
}, 'constructing TextDecoder with SharedArrayBuffer view should throw');
12+
}, 'decoding SharedArrayBuffer');
13+
14+
</script>
Collapse file

‎test/fixtures/wpt/encoding/sharedarraybuffer.https.html.headers‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cross-Origin-Opener-Policy:same-origin
2+
Cross-Origin-Embedder-Policy:require-corp
Collapse file

‎test/fixtures/wpt/encoding/single-byte-decoder.window.js‎

Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/single-byte-decoder.window.js
+107Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

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

Copy file name to clipboardExpand all lines: test/fixtures/wpt/encoding/streams/decode-utf8.any.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@
4343
const array = await readableStreamToArray(output);
4444
assert_array_equals(array, [expectedOutputString],
4545
'the output should be in one chunk');
46-
}, 'a trailing empty chunk should be ignored- ' + arrayBufferOrSharedArrayBuffer);
46+
}, 'a trailing empty chunk should be ignored - ' + arrayBufferOrSharedArrayBuffer);
47+
48+
promise_test(async () => {
49+
const chunk = new Uint8Array(createBuffer(arrayBufferOrSharedArrayBuffer, 3));
50+
chunk.set([0xF0, 0x9F, 0x92]);
51+
const input = readableStreamFromArray([chunk]);
52+
const output = input.pipeThrough(new TextDecoderStream());
53+
const array = await readableStreamToArray(output);
54+
assert_array_equals(array, ['\uFFFD']);
55+
}, 'UTF-8 EOF handling - ' + arrayBufferOrSharedArrayBuffer);
4756
});
4857

4958
promise_test(async () => {
Collapse file

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

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cross-Origin-Opener-Policy: same-origin
2+
Cross-Origin-Embedder-Policy: require-corp
Collapse file

‎test/fixtures/wpt/encoding/textdecoder-copy.any.js.headers‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cross-Origin-Opener-Policy: same-origin
2+
Cross-Origin-Embedder-Policy: require-corp

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.