| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | // From: https://github.com/w3c/web-platform-tests/blob/d74324b53c/encoding/textdecoder-fatal-streaming.html | |
| 4 | + // With the twist that we specifically test for Node.js error codes | ||
| 4 | 5 | ||
| 5 | 6 | const common = require('../common'); | |
| 6 | 7 | ||
@@ -28,6 +29,7 @@ const assert = require('assert'); | |||
| 28 | 29 | } | |
| 29 | 30 | ); | |
| 30 | 31 | ||
| 32 | + // TODO(joyeecheung): remove this when WPT is ported | ||
| 31 | 33 | assert.strictEqual( | |
| 32 | 34 | new TextDecoder(testCase.encoding).decode(data), | |
| 33 | 35 | '\uFFFD' | |
@@ -40,6 +42,7 @@ const assert = require('assert'); | |||
| 40 | 42 | const odd = new Uint8Array([0x00]); | |
| 41 | 43 | const even = new Uint8Array([0x00, 0x00]); | |
| 42 | 44 | ||
| 45 | + // TODO(joyeecheung): remove this when WPT is ported | ||
| 43 | 46 | assert.strictEqual(decoder.decode(odd, { stream: true }), ''); | |
| 44 | 47 | assert.strictEqual(decoder.decode(odd), '\u0000'); | |
| 45 | 48 | ||
@@ -67,6 +70,7 @@ const assert = require('assert'); | |||
| 67 | 70 | } | |
| 68 | 71 | ); | |
| 69 | 72 | ||
| 73 | + // TODO(joyeecheung): remove this when WPT is ported | ||
| 70 | 74 | assert.strictEqual(decoder.decode(even, { stream: true }), '\u0000'); | |
| 71 | 75 | assert.strictEqual(decoder.decode(even), '\u0000'); | |
| 72 | 76 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,8 @@ | |||
| 1 | 1 | // Flags: --expose-internals | |
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | + // This tests internal mapping of the Node.js encoding implementation | ||
| 5 | + | ||
| 4 | 6 | require('../common'); | |
| 5 | 7 | ||
| 6 | 8 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,8 @@ | |||
| 1 | 1 | // Flags: --expose-internals | |
| 2 | + | ||
| 3 | + // This tests interoperability between TextEncoder and TextDecoder with | ||
| 4 | + // Node.js util.inspect and Buffer APIs | ||
| 5 | + | ||
| 2 | 6 | 'use strict'; | |
| 3 | 7 | ||
| 4 | 8 | const common = require('../common'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments