xbintsc 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +21 -3
  2. package/README.zh-CN.md +18 -3
  3. package/dist/src/codegen/generator/calls/access.js +13 -0
  4. package/dist/src/codegen/generator/calls/access.js.map +1 -1
  5. package/dist/src/codegen/generator/calls/invocation.js +8 -2
  6. package/dist/src/codegen/generator/calls/invocation.js.map +1 -1
  7. package/dist/src/codegen/generator/context.d.ts +23 -0
  8. package/dist/src/codegen/generator/context.js +91 -17
  9. package/dist/src/codegen/generator/context.js.map +1 -1
  10. package/dist/src/codegen/generator/expressions/primary.js +5 -0
  11. package/dist/src/codegen/generator/expressions/primary.js.map +1 -1
  12. package/dist/src/driver/compiler.d.ts +7 -0
  13. package/dist/src/driver/compiler.js +41 -5
  14. package/dist/src/driver/compiler.js.map +1 -1
  15. package/dist/src/driver/modules.d.ts +1 -1
  16. package/dist/src/driver/modules.js +235 -25
  17. package/dist/src/driver/modules.js.map +1 -1
  18. package/dist/src/extensions/node/fs/fs-ops.d.ts +5 -2
  19. package/dist/src/extensions/node/fs/fs-ops.js +45 -6
  20. package/dist/src/extensions/node/fs/fs-ops.js.map +1 -1
  21. package/dist/src/extensions/node/fs/index.d.ts +6 -2
  22. package/dist/src/extensions/node/fs/index.js +22 -3
  23. package/dist/src/extensions/node/fs/index.js.map +1 -1
  24. package/dist/src/extensions/node/fs-promises/index.d.ts +4 -3
  25. package/dist/src/extensions/node/fs-promises/index.js +31 -3
  26. package/dist/src/extensions/node/fs-promises/index.js.map +1 -1
  27. package/dist/tests/cli/main.test.js +17 -0
  28. package/dist/tests/cli/main.test.js.map +1 -1
  29. package/dist/tests/driver/compiler.test.js +93 -2
  30. package/dist/tests/driver/compiler.test.js.map +1 -1
  31. package/dist/tests/driver/modules.test.js +91 -4
  32. package/dist/tests/driver/modules.test.js.map +1 -1
  33. package/dist/tests/e2e/compile-node.test.js +240 -0
  34. package/dist/tests/e2e/compile-node.test.js.map +1 -1
  35. package/dist/tests/e2e/compile.test.js +12 -0
  36. package/dist/tests/e2e/compile.test.js.map +1 -1
  37. package/dist/tests/e2e/harness.js +11 -8
  38. package/dist/tests/e2e/harness.js.map +1 -1
  39. package/dist/tests/e2e/node-modules.test.js +1 -1
  40. package/dist/tests/e2e/node-modules.test.js.map +1 -1
  41. package/dist/tests/e2e/npm-modules.test.d.ts +9 -0
  42. package/dist/tests/e2e/npm-modules.test.js +55 -0
  43. package/dist/tests/e2e/npm-modules.test.js.map +1 -0
  44. package/dist/tests/e2e/runtime-coverage.test.d.ts +11 -0
  45. package/dist/tests/e2e/runtime-coverage.test.js +646 -0
  46. package/dist/tests/e2e/runtime-coverage.test.js.map +1 -0
  47. package/package.json +3 -2
  48. package/runtime/ext_node/buffer/parts/prototype.inc +7 -0
  49. package/runtime/ext_node/buffer/parts/search.inc +8 -4
  50. package/runtime/ext_node/child_process/child_process.c +5 -0
  51. package/runtime/ext_node/fs/constants.c +113 -0
  52. package/runtime/ext_node/fs/copy_ops.c +145 -0
  53. package/runtime/ext_node/fs/dir.c +101 -0
  54. package/runtime/ext_node/fs/fd_ops.c +405 -0
  55. package/runtime/ext_node/fs/fs_common.h +388 -5
  56. package/runtime/ext_node/fs/fs_ops.c +100 -139
  57. package/runtime/ext_node/fs/glob.c +232 -0
  58. package/runtime/ext_node/fs/link_ops.c +91 -0
  59. package/runtime/ext_node/fs/meta_ops.c +403 -0
  60. package/runtime/ext_node/fs/promises.c +275 -60
  61. package/runtime/ext_node/fs/read_file.c +8 -4
  62. package/runtime/ext_node/fs/watch.c +52 -0
  63. package/runtime/ext_node/fs/write_file.c +20 -11
  64. package/runtime/ext_node/stream/stream.c +19 -2
  65. package/runtime/rt.h +9 -0
  66. package/runtime/xt_io.c +21 -0
  67. package/scripts/coverage-runtime.ts +338 -0
  68. package/src/codegen/generator/calls/access.ts +15 -0
  69. package/src/codegen/generator/calls/invocation.ts +8 -2
  70. package/src/codegen/generator/context.ts +112 -21
  71. package/src/codegen/generator/expressions/primary.ts +5 -0
  72. package/src/driver/compiler.ts +42 -5
  73. package/src/driver/modules.ts +251 -26
  74. package/src/extensions/node/fs/fs-ops.ts +48 -6
  75. package/src/extensions/node/fs/index.ts +25 -3
  76. package/src/extensions/node/fs-promises/index.ts +33 -4
@@ -0,0 +1,646 @@
1
+ /**
2
+ * Runtime-coverage end-to-end tests.
3
+ *
4
+ * These programs are deliberately broad: each one drives a whole Node
5
+ * compatibility module through its common (and a few uncommon) paths so the
6
+ * instrumented C runtime sees as many branches as possible. They are ordinary
7
+ * black-box tests as well — every case asserts the exact output of the compiled
8
+ * binary — but their primary purpose is to keep `npm run coverage:runtime`
9
+ * above its floor.
10
+ */
11
+ import { expect, it } from "vitest";
12
+ import { describeE2E } from "./harness.js";
13
+ const TIMEOUT = 120000;
14
+ describeE2E("runtime coverage", (h) => {
15
+ it("exercises the Buffer implementation", () => {
16
+ const source = `
17
+ const b = Buffer.from("hello");
18
+ console.log(b.toString(), b.length, Buffer.isBuffer(b));
19
+ console.log(Buffer.from([1, 2, 3]).toString("hex"));
20
+ console.log(Buffer.from("68656c6c6f", "hex").toString());
21
+ console.log(Buffer.from("aGVsbG8=", "base64").toString());
22
+ console.log(Buffer.from(b).toString());
23
+ console.log(Buffer.alloc(3).toString("hex"), Buffer.alloc(4, 65).toString(), Buffer.alloc(3, "ab").toString());
24
+ console.log(Buffer.alloc(0).length, Buffer.alloc(3, "").toString("hex"), Buffer.alloc(3, "61", "hex").toString("hex"));
25
+ console.log(Buffer.allocUnsafe(2).length, Buffer.allocUnsafeSlow(2).length);
26
+ console.log(Buffer.byteLength("hello"), Buffer.byteLength("68656c6c6f", "hex"), Buffer.byteLength("aGVsbG8=", "base64"), Buffer.byteLength(b));
27
+ console.log(Buffer.concat([Buffer.from("foo"), Buffer.from("bar")]).toString());
28
+ console.log(Buffer.concat([Buffer.from("foo"), Buffer.from("bar")], 4).toString());
29
+ console.log(Buffer.compare(Buffer.from("a"), Buffer.from("b")), Buffer.compare(Buffer.from("b"), Buffer.from("a")), Buffer.compare(Buffer.from("a"), Buffer.from("a")));
30
+ const n = new Buffer("hey");
31
+ console.log(n.toString(), Buffer.of().length, new Buffer(2).length);
32
+ const j = Buffer.from("hi").toJSON();
33
+ console.log(j.type, j.data.join(","));
34
+ console.log(b.slice(1, 3).toString(), b.slice(-3).toString(), b.subarray(0, 2).toString(), "[" + b.slice(3, 1).toString() + "]");
35
+ console.log(Buffer.from("abc").equals(Buffer.from("abc")), Buffer.from("abc").equals(Buffer.from("abd")), true);
36
+ console.log(Buffer.from("abc").compare(Buffer.from("abd")), Buffer.from("abd").compare(Buffer.from("abc")), Buffer.from("abc").compare(Buffer.from("abc")));
37
+ const target = Buffer.alloc(6);
38
+ const copied = Buffer.from("hello").copy(target, 1, 0, 3);
39
+ console.log(copied, target.toString("hex"));
40
+ const w = Buffer.alloc(8);
41
+ console.log(w.write("abc"), w.write("def", 4), w.toString("hex"));
42
+ console.log(w.write("6161", 0, 4, "hex"), w.toString("hex"));
43
+ console.log(Buffer.alloc(5).fill("a").toString(), Buffer.alloc(5, 1).fill(66, 1, 3).toString("hex"), Buffer.alloc(2).fill(0).toString("hex"));
44
+ console.log(Buffer.from("abc").reverse().toString());
45
+ console.log(b.toString("hex"));
46
+ console.log(Buffer.from("hello world").indexOf("world"), Buffer.from("hello world").indexOf("o"), Buffer.from("hello").indexOf(101), Buffer.from("hello").indexOf(Buffer.from("ll")));
47
+ console.log(Buffer.from("hello world").lastIndexOf("o"), Buffer.from("hello").lastIndexOf("l", 2), Buffer.from("abc").includes("bc"), Buffer.from("abc").includes("z"));
48
+ console.log(Buffer.from("hello").indexOf("z"), Buffer.from("hello").indexOf("toolong"), Buffer.from("hello").indexOf(""), Buffer.from("hello").indexOf("l", -10), Buffer.from("hello").indexOf("l", 100));
49
+ console.log(Buffer.from("hello").lastIndexOf("l", 100), Buffer.from("hello").lastIndexOf("l", -1), Buffer.from("hello").lastIndexOf("lo", 3), Buffer.from("hello").lastIndexOf(111));
50
+ console.log(Buffer.from("hello").indexOf("6c6c", 0, "hex"));
51
+ const io = Buffer.alloc(16);
52
+ console.log(io.writeUInt8(200, 0), io.writeInt8(-56, 1), io.readUInt8(0), io.readInt8(1));
53
+ io.writeUInt16LE(0x1234, 2);
54
+ io.writeUInt16BE(0x1234, 4);
55
+ io.writeUInt16LE(0xfffe, 6);
56
+ io.writeUInt16BE(0xfffe, 8);
57
+ console.log(io.readUInt16LE(2), io.readUInt16BE(4), io.readInt16LE(6), io.readInt16BE(8));
58
+ io.writeUInt32LE(0xffffffff, 0);
59
+ console.log(io.readUInt32LE(0), io.readInt32LE(0));
60
+ io.writeUInt32BE(0x12345678, 4);
61
+ console.log(io.readUInt32BE(4), io.readInt32BE(4));
62
+ console.log(Array.from(Buffer.from("abc").keys()).join(","), Array.from(Buffer.from("abc").values()).join(","));
63
+ console.log(b.toString("base64"), b.toString("hex", 1, 3), "[" + b.toString("utf8", 3, 1) + "]");
64
+ `;
65
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
66
+ expect(stdout.split("\n")).toEqual([
67
+ "hello 5 true",
68
+ "010203",
69
+ "hello",
70
+ "hello",
71
+ "hello",
72
+ "000000 AAAA aba",
73
+ "0 000000 616161",
74
+ "2 2",
75
+ "5 5 6 5",
76
+ "foobar",
77
+ "foob",
78
+ "-1 1 0",
79
+ "hey 0 2",
80
+ "Buffer 104,105",
81
+ "el llo he []",
82
+ "true false true",
83
+ "-1 1 0",
84
+ "3 0068656c0000",
85
+ "3 3 6162630064656600",
86
+ "2 6161630064656600",
87
+ "aaaaa 0142420101 0000",
88
+ "cba",
89
+ "68656c6c6f",
90
+ "6 4 1 2",
91
+ "7 2 true false",
92
+ "-1 -1 -1 2 -1",
93
+ "3 3 3 4",
94
+ "2",
95
+ "1 2 200 -56",
96
+ "4660 4660 -2 -2",
97
+ "4294967295 -1",
98
+ "305419896 305419896",
99
+ "0,1,2 97,98,99",
100
+ "aGVsbG8= 656c []",
101
+ ]);
102
+ });
103
+ it("exercises util helpers and predicates", () => {
104
+ const source = `
105
+ import util, {
106
+ format, formatWithOptions, inspect, isDeepStrictEqual, inherits, deprecate, promisify,
107
+ isString, isNumber, isBoolean, isUndefined, isNull, isFunction, isArray, isObject,
108
+ isBuffer, isDate, isRegExp, isPromise, isError,
109
+ } from "util";
110
+
111
+ console.log(format("%s %d %i %f %j %o %O %% %c", "s", 3.9, 4.2, 1.5, { a: 1 }, { b: 2 }, [1, 2], "css"));
112
+ console.log(format("%s", { a: 1 }), "|", format("%d", "5"), "|", format("%f", "2.5"));
113
+ console.log(format(1, "two", { three: 3 }));
114
+ console.log(format("only %s"), "|", format("%s and %d", "a"));
115
+ console.log(formatWithOptions({ colors: true }, "%s=%d", "x", 2));
116
+ console.log(inspect(undefined), inspect(null), inspect(true), inspect(1), inspect(10n), inspect("str"));
117
+ console.log(inspect([1, [2, [3, [4]]]]));
118
+ console.log(inspect({ a: 1, nested: { b: [1, 2] } }));
119
+ function f(): void {}
120
+ console.log(inspect(f));
121
+ console.log(inspect(new Date(0)));
122
+ console.log(inspect(/ab+c/gi));
123
+ console.log(isDeepStrictEqual({ a: [1, { b: 2 }] }, { a: [1, { b: 2 }] }), isDeepStrictEqual({ a: 1 }, { a: 2 }));
124
+ console.log(isDeepStrictEqual([1, 2], [1, 2, 3]), isDeepStrictEqual(NaN, NaN));
125
+ class Base {}
126
+ class Derived extends Base {}
127
+ const d = new Derived();
128
+ console.log(d instanceof Base);
129
+ const dep = deprecate(f, "old");
130
+ console.log(dep === f);
131
+ function addAsync(a: number, b: number, cb: (e: unknown, v: number) => void): void { cb(null, a + b); }
132
+ function failAsync(cb: (e: unknown, v: unknown) => void): void { cb(new Error("boom"), null); }
133
+ const add = promisify(addAsync);
134
+ add(2, 3).then((v: number) => { console.log("add", v); });
135
+ const failing = promisify(failAsync);
136
+ failing().then(() => { console.log("no"); }, (e: any) => { console.log("err", e.message); });
137
+ console.log(
138
+ isString("x"), isNumber(1), isBoolean(true), isUndefined(undefined), isNull(null),
139
+ isFunction(f), isArray([]), isObject({}), isBuffer(Buffer.from("x")), isDate(new Date()),
140
+ isRegExp(/x/), isPromise(Promise.resolve(1)), isError(new Error("e")),
141
+ );
142
+ console.log(util.format("%s!", "ns"), util.isNumber(3));
143
+ `;
144
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
145
+ expect(stdout.split("\n")).toEqual([
146
+ "s 3 4 1.500000 {\"a\":1} { b: 2 } [ 1, 2 ] % 'css'",
147
+ "{ a: 1 } | 5 | 2.500000",
148
+ "1 'two' { three: 3 }",
149
+ "only %s | a and %d",
150
+ "x=2",
151
+ "undefined null true 1 10n 'str'",
152
+ "[ 1, [ 2, [Array] ] ]",
153
+ "{ a: 1, nested: { b: [Array] } }",
154
+ "[Function]",
155
+ "[object Object]",
156
+ "[object Object]",
157
+ "true false",
158
+ "false true",
159
+ "true",
160
+ "false",
161
+ "true true true true true true true true true true true true true",
162
+ "ns! true",
163
+ "add 5",
164
+ "err boom",
165
+ ]);
166
+ });
167
+ it("exercises the assert module", () => {
168
+ const source = `
169
+ import assert, { strictEqual, deepStrictEqual, throws, doesNotThrow, ifError, match, doesNotMatch, notStrictEqual, ok, equal, notEqual, deepEqual, notDeepEqual, rejects, doesNotReject } from "node:assert";
170
+
171
+ function check(label: string, fn: () => void): void {
172
+ try {
173
+ fn();
174
+ console.log(label, "ok");
175
+ } catch (e: any) {
176
+ console.log(label, "threw", e.name);
177
+ }
178
+ }
179
+
180
+ check("ok-pass", () => assert.ok(1));
181
+ check("ok-fail", () => assert.ok(0));
182
+ check("equal-pass", () => assert.equal(1, "1"));
183
+ check("equal-fail", () => assert.equal(1, 2, "custom equal"));
184
+ check("notEqual-pass", () => assert.notEqual(1, 2));
185
+ check("notEqual-fail", () => assert.notEqual(1, "1"));
186
+ check("strictEqual-pass", () => assert.strictEqual(1, 1));
187
+ check("strictEqual-fail", () => assert.strictEqual(1, "1"));
188
+ check("notStrictEqual-pass", () => assert.notStrictEqual(1, "1"));
189
+ check("notStrictEqual-fail", () => assert.notStrictEqual(1, 1));
190
+ check("deepEqual-pass", () => assert.deepEqual({ a: [1, 2] }, { a: [1, 2] }));
191
+ check("deepEqual-fail", () => assert.deepEqual({ a: 1 }, { a: 2 }));
192
+ check("notDeepEqual-pass", () => assert.notDeepEqual({ a: 1 }, { a: 2 }));
193
+ check("notDeepEqual-fail", () => assert.notDeepEqual({ a: 1 }, { a: 1 }));
194
+ check("deepStrictEqual-pass", () => assert.deepStrictEqual([1, { b: 2 }], [1, { b: 2 }]));
195
+ check("deepStrictEqual-fail", () => assert.deepStrictEqual([1], [2]));
196
+ check("notDeepStrictEqual-pass", () => assert.notDeepStrictEqual([1], [2]));
197
+ check("throws-pass", () => assert.throws(() => { throw new Error("x"); }));
198
+ check("throws-fail", () => assert.throws(() => {}));
199
+ check("throws-nonfn", () => assert.throws(1 as any));
200
+ check("throws-message", () => assert.throws(() => { throw new Error("x"); }, "boom"));
201
+ check("doesNotThrow-pass", () => assert.doesNotThrow(() => {}));
202
+ check("doesNotThrow-fail", () => assert.doesNotThrow(() => { throw new Error("y"); }));
203
+ check("ifError-null", () => assert.ifError(null));
204
+ check("ifError-undefined", () => assert.ifError(undefined));
205
+ check("ifError-obj", () => assert.ifError(new Error("z")));
206
+ check("ifError-value", () => assert.ifError("bad"));
207
+ check("match-regexp", () => assert.match("hello", /ell/));
208
+ check("match-string", () => assert.match("hello", "ell"));
209
+ check("match-fail", () => assert.match("hello", /xyz/, "no match"));
210
+ check("doesNotMatch-pass", () => assert.doesNotMatch("hello", /xyz/));
211
+ check("doesNotMatch-fail", () => assert.doesNotMatch("hello", /ell/));
212
+ check("fail-default", () => assert.fail());
213
+ check("fail-custom", () => assert.fail("custom failure"));
214
+
215
+ strictEqual(1, 1);
216
+ deepStrictEqual({ x: 1 }, { x: 1 });
217
+ throws(() => { throw new Error("n"); });
218
+ doesNotThrow(() => {});
219
+ ifError(null);
220
+ match("abc", /b/);
221
+ doesNotMatch("abc", /z/);
222
+ notStrictEqual(1, 2);
223
+ ok(true);
224
+ equal(1, "1");
225
+ notEqual(1, 2);
226
+ deepEqual([1], [1]);
227
+ notDeepEqual([1], [2]);
228
+ rejects();
229
+ doesNotReject();
230
+ console.log("named-imports ok");
231
+ `;
232
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
233
+ expect(stdout.split("\n")).toEqual([
234
+ "ok-pass ok",
235
+ "ok-fail threw AssertionError",
236
+ "equal-pass ok",
237
+ "equal-fail threw AssertionError",
238
+ "notEqual-pass ok",
239
+ "notEqual-fail threw AssertionError",
240
+ "strictEqual-pass ok",
241
+ "strictEqual-fail threw AssertionError",
242
+ "notStrictEqual-pass ok",
243
+ "notStrictEqual-fail threw AssertionError",
244
+ "deepEqual-pass ok",
245
+ "deepEqual-fail threw AssertionError",
246
+ "notDeepEqual-pass ok",
247
+ "notDeepEqual-fail threw AssertionError",
248
+ "deepStrictEqual-pass ok",
249
+ "deepStrictEqual-fail threw AssertionError",
250
+ "notDeepStrictEqual-pass ok",
251
+ "throws-pass ok",
252
+ "throws-fail threw AssertionError",
253
+ "throws-nonfn threw AssertionError",
254
+ "throws-message ok",
255
+ "doesNotThrow-pass ok",
256
+ "doesNotThrow-fail threw AssertionError",
257
+ "ifError-null ok",
258
+ "ifError-undefined ok",
259
+ "ifError-obj threw Error",
260
+ "ifError-value threw AssertionError",
261
+ "match-regexp ok",
262
+ "match-string ok",
263
+ "match-fail threw AssertionError",
264
+ "doesNotMatch-pass ok",
265
+ "doesNotMatch-fail threw AssertionError",
266
+ "fail-default threw AssertionError",
267
+ "fail-custom threw AssertionError",
268
+ "named-imports ok",
269
+ ]);
270
+ });
271
+ it("converts between file paths and file URLs", () => {
272
+ const source = `
273
+ import { pathToFileURL, fileURLToPath } from "url";
274
+ import url from "url";
275
+
276
+ const u = pathToFileURL("/tmp/a b");
277
+ console.log(u.protocol, u.href.startsWith("file://"), u.href.includes("a b"));
278
+ console.log(fileURLToPath("file:///tmp/a%20b"));
279
+ console.log(fileURLToPath("file://localhost/tmp/c"));
280
+ console.log(fileURLToPath("/tmp/plain"));
281
+ console.log(url.pathToFileURL("/tmp/x").href.startsWith("file://"));
282
+ `;
283
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
284
+ expect(stdout.split("\n")).toEqual([
285
+ "file: true true",
286
+ "/tmp/a b",
287
+ "/tmp/c",
288
+ "/tmp/plain",
289
+ "true",
290
+ ]);
291
+ });
292
+ it("reads operating-system and process information", () => {
293
+ const source = `
294
+ import os from "os";
295
+ import * as os2 from "node:os";
296
+ import process from "process";
297
+ import * as proc from "node:process";
298
+
299
+ console.log(os.platform().length > 0, os.type().length > 0, os.arch().length > 0, os.endianness().length > 0);
300
+ console.log(os.homedir().length > 0, os.tmpdir().length > 0, os.hostname().length > 0, os.release().length > 0);
301
+ console.log(os.totalmem() > 0, os.freemem() > 0, os.cpus().length > 0, os2.cpus()[0].model.length > 0);
302
+ console.log(os2.platform().length > 0);
303
+ console.log(process.platform.length > 0, process.arch.length > 0, process.pid > 0, process.ppid >= 0, process.version.length > 0);
304
+ console.log(process.cwd().length > 0, process.uptime() >= 0, process.hrtime().length === 2);
305
+ console.log(process.getuid() >= 0, process.argv.length >= 1, Object.keys(process.env).length > 0);
306
+ process.stdout.write("stdout-write\\n");
307
+ process.stderr.write("stderr-write\\n");
308
+ console.log(proc.cwd().length > 0, proc.platform.length > 0, proc.getuid() >= 0);
309
+ `;
310
+ const result = h.runProgramFull(source, { extensions: true, timeout: TIMEOUT });
311
+ expect(result.status).toBe(0);
312
+ expect(result.stdout.trim().split("\n")).toEqual([
313
+ "true true true true",
314
+ "true true true true",
315
+ "true true true true",
316
+ "true",
317
+ "true true true true true",
318
+ "true true true",
319
+ "true true true",
320
+ "stdout-write",
321
+ "true true true",
322
+ ]);
323
+ expect(result.stderr.trim()).toBe("stderr-write");
324
+ });
325
+ it("spawns child processes synchronously", () => {
326
+ const source = `
327
+ import { spawnSync } from "node:child_process";
328
+
329
+ let isChild = false;
330
+ for (const arg of process.argv) {
331
+ if (arg === "xb-child-capture") isChild = true;
332
+ }
333
+ if (isChild) {
334
+ console.log("from-child");
335
+ console.error("child-err");
336
+ console.log("x".repeat(5000));
337
+ } else {
338
+ const r = spawnSync(process.argv[0], ["xb-child-capture"], { encoding: "utf8" });
339
+ console.log("status", r.status, "out", r.stdout.trim().length, "err", r.stderr.trim());
340
+ const missing = spawnSync("definitely-not-a-real-command-xyz", [], {});
341
+ console.log("missing", missing.status !== 0);
342
+ const cd = spawnSync(process.argv[0], ["xb-child-capture"], { cwd: process.cwd() });
343
+ console.log("cwd-status", cd.status);
344
+ }
345
+ `;
346
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
347
+ expect(stdout.split("\n")).toEqual([
348
+ "status 0 out 5011 err child-err",
349
+ "missing true",
350
+ "cwd-status 0",
351
+ ]);
352
+ });
353
+ it("hashes data with crypto", () => {
354
+ const source = `
355
+ import { createHash } from "crypto";
356
+ import crypto from "node:crypto";
357
+
358
+ console.log(createHash("sha256").update("abc").digest("hex"));
359
+ console.log(createHash("sha-256").update("abc").digest("hex"));
360
+ console.log(createHash("sha1").update("abc").digest("hex"));
361
+ console.log(createHash("sha-1").update("abc").digest("hex"));
362
+ console.log(createHash("sha256").update("x".repeat(100)).digest("base64"));
363
+ const h = createHash("sha256");
364
+ h.update("ab");
365
+ h.update("c");
366
+ console.log(h.digest("hex"));
367
+ const s = createHash("sha256");
368
+ s.setEncoding("base64");
369
+ s.write("ab");
370
+ s.write("c");
371
+ s.end("d");
372
+ console.log(s.read());
373
+ const u = createHash("md5");
374
+ console.log(u.update("abc").digest("hex").length);
375
+ console.log(crypto.createHash("sha256").update("abc").digest("latin1").length);
376
+ `;
377
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
378
+ expect(stdout.split("\n")).toEqual([
379
+ "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
380
+ "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
381
+ "a9993e364706816aba3e25717850c26c9cd0d89d",
382
+ "a9993e364706816aba3e25717850c26c9cd0d89d",
383
+ "Cey268i878cz9vLsRPeRq+7WqZ7fDMMVGWN4mK69Utg=",
384
+ "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
385
+ "iNQmb9TmM40TuEX88olXnSCciXgjuSF9o+Fhk28DFYk=",
386
+ "0",
387
+ "32",
388
+ ]);
389
+ });
390
+ it("drives the stream surface", () => {
391
+ const source = `
392
+ import { Readable, Writable, Duplex, Transform, PassThrough } from "stream";
393
+
394
+ const r = new Readable({});
395
+ r.push("a");
396
+ r.push("b");
397
+ console.log("read1", r.read());
398
+ r.unshift("z");
399
+ console.log("read2", r.read());
400
+ r.setEncoding("utf8");
401
+ console.log("paused", r.isPaused());
402
+ r.pause();
403
+ console.log("paused2", r.isPaused());
404
+ r.resume();
405
+ console.log("paused3", r.isPaused());
406
+ r.push(null);
407
+ console.log("read3", r.read());
408
+
409
+ const w = new Writable({ write(chunk: string, enc: string, cb: () => void) { console.log("write-fn", chunk); cb(); } });
410
+ w.write("hello");
411
+ w.cork();
412
+ w.uncork();
413
+ w.end("bye", () => { console.log("end-cb"); });
414
+
415
+ const t = new Transform((chunk: string, enc: string, cb: (e: unknown, v: string) => void) => { cb(null, chunk.toUpperCase()); });
416
+ t.on("data", (d: string) => { console.log("transform-data", d); });
417
+ t.write("abc");
418
+
419
+ const pt = new PassThrough();
420
+ pt.on("data", (d: string) => { console.log("pt-data", d); });
421
+ pt.write("pass");
422
+ pt.end();
423
+
424
+ const d = new Duplex({ write(chunk: string, enc: string, cb: () => void) { cb(); } });
425
+ d.on("data", (v: string) => { console.log("duplex-data", v); });
426
+ d.write("duplex");
427
+
428
+ const r2 = Readable.from(["x", "y"]);
429
+ r2.on("data", (v: string) => { console.log("from-data", v); });
430
+
431
+ const src = new Readable({});
432
+ src.push("p1");
433
+ src.push("p2");
434
+ const dest = new Writable({ write(c: string, e: string, cb: () => void) { console.log("pipe-dest", c); cb(); } });
435
+ dest.on("finish", () => { console.log("dest-finish"); });
436
+ src.pipe(dest);
437
+ src.push(null);
438
+
439
+ const d2 = new Readable({});
440
+ d2.on("error", (e: any) => { console.log("stream-err", e.message); });
441
+ d2.on("close", () => { console.log("stream-close"); });
442
+ d2.destroy(new Error("boom"));
443
+ `;
444
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
445
+ expect(stdout.split("\n")).toEqual([
446
+ "read1 a",
447
+ "read2 z",
448
+ "paused false",
449
+ "paused2 true",
450
+ "paused3 false",
451
+ "read3 b",
452
+ "write-fn hello",
453
+ "write-fn bye",
454
+ "end-cb",
455
+ "transform-data ABC",
456
+ "pt-data pass",
457
+ "duplex-data duplex",
458
+ "from-data x",
459
+ "from-data y",
460
+ "pipe-dest p1",
461
+ "pipe-dest p2",
462
+ "dest-finish",
463
+ "stream-err boom",
464
+ "stream-close",
465
+ ]);
466
+ });
467
+ it("covers Object, Map, Set and JSON globals", () => {
468
+ const source = `
469
+ console.log(Object.keys({a:1,b:2}).join(","), Object.values({a:1,b:2}).join(","), Object.entries({a:1,b:2}).map(e => e[0]+e[1]).join(","));
470
+ console.log(Object.getOwnPropertyNames([1,2]).join(","), Object.getOwnPropertyNames("ab").join(","));
471
+ console.log(Object.assign({a:1}, {b:2}, {a:3}).a, Object.assign({}, {b:2}).b);
472
+ const fz = Object.freeze({x:1});
473
+ console.log(Object.isFrozen(fz), Object.isFrozen({}));
474
+ console.log(Object.hasOwn({x:1},"x"), Object.hasOwn({x:1},"y"));
475
+ console.log(Object.is(NaN, NaN), Object.is(0, -0), Object.is(1,1), Object.is({},{}));
476
+ const proto = { greet() { return "hi"; } };
477
+ const child = Object.create(proto);
478
+ console.log(child.greet(), Object.getPrototypeOf(child) === proto);
479
+ const grouped = Object.groupBy([1,2,3,4], (n: number) => n % 2 === 0 ? "even" : "odd");
480
+ console.log(grouped.odd.join(","), grouped.even.join(","));
481
+ console.log(Object.fromEntries([["a",1],["b",2]]).a);
482
+ console.log(JSON.stringify({a:1,b:[2,3],c:"x"}), JSON.parse('{"a":1,"b":[2,3]}').b[1]);
483
+ const m = new Map<string, number>(); m.set("a",1); m.set("b",2); console.log(m.get("a"), m.size, m.has("b"), m.delete("a"), m.size);
484
+ const s = new Set<number>(); s.add(1); s.add(2); s.add(1); console.log(s.size, s.has(2), s.delete(1), s.size);
485
+ console.log([...m.keys()].join(","), [...s.values()].join(","));
486
+ `;
487
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
488
+ expect(stdout.split("\n")).toEqual([
489
+ "a,b 1,2 a1,b2",
490
+ "0,1,length 0,1,length",
491
+ "3 2",
492
+ "true false",
493
+ "true false",
494
+ "true false true false",
495
+ "hi true",
496
+ "1,3 2,4",
497
+ "1",
498
+ '{"a":1,"b":[2,3],"c":"x"} 3',
499
+ "1 2 true true 1",
500
+ "2 true true 1",
501
+ "b 2",
502
+ ]);
503
+ });
504
+ it("drives EventEmitter listeners and events.once", () => {
505
+ const source = `
506
+ import { EventEmitter } from "events";
507
+ import events from "node:events";
508
+ const e = new EventEmitter();
509
+ e.on("a", (x: number) => { console.log("a1", x); });
510
+ e.prependListener("a", (x: number) => { console.log("a0", x); });
511
+ e.once("b", (x: number) => { console.log("b once", x); });
512
+ e.on("b", (x: number) => { console.log("b always", x); });
513
+ e.emit("a", 1);
514
+ e.emit("b", 2);
515
+ e.emit("b", 3);
516
+ console.log(e.listenerCount("b"), e.eventNames().join(","), e.listeners("b").length);
517
+ e.removeAllListeners("a");
518
+ console.log(e.listenerCount("a"));
519
+ e.setMaxListeners(20);
520
+ console.log(e.getMaxListeners());
521
+ e.on("c", () => { console.log("c"); });
522
+ e.removeAllListeners();
523
+ console.log(e.eventNames().length);
524
+ const e2 = new EventEmitter();
525
+ events.once(e2, "done").then((v: any) => { console.log("once", v[0]); });
526
+ e2.emit("done", 42);
527
+ `;
528
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
529
+ expect(stdout.split("\n")).toEqual([
530
+ "a0 1",
531
+ "a1 1",
532
+ "b once 2",
533
+ "b always 2",
534
+ "b always 3",
535
+ "1 a,b 1",
536
+ "0",
537
+ "20",
538
+ "0",
539
+ "once undefined",
540
+ ]);
541
+ });
542
+ it("uses the console surface, inspect and base64 helpers", () => {
543
+ const source = `
544
+ console.count("x");
545
+ console.count("x");
546
+ console.countReset("x");
547
+ console.count("x");
548
+ console.group("g");
549
+ console.groupEnd();
550
+ console.assert(true, "no");
551
+ console.assert(false, "assert-msg");
552
+ console.dir({ a: 1 });
553
+ console.time("t");
554
+ console.timeLog("t");
555
+ console.timeEnd("t");
556
+ console.table([{ a: 1 }, { a: 2 }]);
557
+ console.warn("warn");
558
+ console.error("err");
559
+ console.info("info");
560
+ console.log(btoa("hello"), atob("aGVsbG8="));
561
+ const cyc: any = { a: 1 };
562
+ cyc.self = cyc;
563
+ console.log(cyc);
564
+ console.log({ b: 2, a: 1 });
565
+ console.log([1, "two", true, null, undefined, 3n]);
566
+ console.log(import.meta.url.length > 0, typeof import.meta.dirname, typeof import.meta.filename);
567
+ `;
568
+ const stdout = h
569
+ .runProgram(source, { extensions: true, timeout: TIMEOUT })
570
+ .split("\n")
571
+ .map((line) => (/^t: .*ms$/.test(line) ? "t: <time>" : line))
572
+ .join("\n");
573
+ expect(stdout.split("\n")).toEqual([
574
+ "x: 1",
575
+ "x: 2",
576
+ "x: 1",
577
+ "g",
578
+ "{ a: 1 }",
579
+ "t: <time>",
580
+ "t: <time>",
581
+ "[ { a: 1 }, { a: 2 } ]",
582
+ "info",
583
+ "aGVsbG8= hello",
584
+ "{ a: 1, self: [Circular *1] }",
585
+ "{ b: 2, a: 1 }",
586
+ "[ 1, 'two', true, null, undefined, 3n ]",
587
+ "true string string",
588
+ ]);
589
+ });
590
+ it("computes with BigInt", () => {
591
+ const source = `
592
+ console.log(BigInt("123"), BigInt(456), BigInt(true), BigInt(false), BigInt(10n));
593
+ console.log(10n + 20n, 10n - 3n, 2n * 3n, 10n / 3n, 10n % 3n, 2n ** 10n);
594
+ console.log(-5n, +5n, 5n < 10n, 5n == 5, 5n === 5);
595
+ console.log(255n & 15n, 255n | 15n, 255n ^ 15n, ~0n, 1n << 4n, 256n >> 4n);
596
+ console.log(10n > 5n, 10n >= 10n, 10n < 11n, 10n <= 9n, 5n != 6n, 5n !== 6);
597
+ console.log((123456789012345678901234567890n).toString());
598
+ console.log(Number(10n), +10n, (10n).toString(16), (255n).toString(2), (10n).toString(36));
599
+ try { BigInt(3.5); console.log("no"); } catch (e: any) { console.log("range threw"); }
600
+ try { BigInt({} as any); console.log("no"); } catch (e: any) { console.log("type threw"); }
601
+ console.log(5n ** 0n, 0n ** 5n, 2n ** 64n);
602
+ console.log((0n).toString(16), (-255n).toString(16));
603
+ console.log(BigInt(-12), (-12n).toString(), (-10n) / 3n, (-10n) % 3n);
604
+ console.log(100000000000000000000n + 1n, 99999999999999999999n * 3n);
605
+ console.log(18446744073709551616n > 18446744073709551615n, 18446744073709551615n < 18446744073709551616n, 18446744073709551616n === 18446744073709551616n);
606
+ console.log(1n << 100n, 1n << 200n, 2n ** 100n, 2n ** 200n);
607
+ console.log(-1n & 255n, -1n | 0n, -5n ^ 3n, ~255n, -256n >> 4n, -1n >> 100n);
608
+ console.log(BigInt("0xff"), BigInt("0b101"), BigInt("0o17"), BigInt(" 42 "));
609
+ try { BigInt("abc"); console.log("no"); } catch (e: any) { console.log("syntax threw"); }
610
+ console.log(BigInt("-0"), BigInt("+5"), (255n).toString(8), (255n).toString(16));
611
+ console.log(0n == 0, 0n === 0, 1n < 1, 1n > 0.5);
612
+ console.log((2n ** 64n) / 3n, (2n ** 64n) % 7n);
613
+ console.log((-(2n ** 64n)) / 3n, (-(2n ** 64n)) % 7n);
614
+ console.log((10n).valueOf(), (10n) + "");
615
+ console.log(9007199254740993n, BigInt(9007199254740993));
616
+ `;
617
+ const stdout = h.runProgram(source, { extensions: true, timeout: TIMEOUT });
618
+ expect(stdout.split("\n")).toEqual([
619
+ "123n 456n 1n 0n 10n",
620
+ "30n 7n 6n 3n 1n 1024n",
621
+ "-5n 5n true true false",
622
+ "15n 255n 240n -1n 16n 16n",
623
+ "true true true false true true",
624
+ "123456789012345678901234567890",
625
+ "10 10n a 11111111 a",
626
+ "range threw",
627
+ "type threw",
628
+ "1n 0n 18446744073709551616n",
629
+ "0 -ff",
630
+ "-12n -12 -3n -1n",
631
+ "100000000000000000001n 299999999999999999997n",
632
+ "true true true",
633
+ "1267650600228229401496703205376n 1606938044258990275541962092341162602522202993782792835301376n 1267650600228229401496703205376n 1606938044258990275541962092341162602522202993782792835301376n",
634
+ "255n -1n -8n -256n -16n -1n",
635
+ "255n 5n 15n 42n",
636
+ "syntax threw",
637
+ "0n 5n 377 ff",
638
+ "true false false true",
639
+ "6148914691236517205n 2n",
640
+ "-6148914691236517205n -2n",
641
+ "10n 10",
642
+ "9007199254740993n 9007199254740992n",
643
+ ]);
644
+ });
645
+ }, { tmpPrefix: "xbintsc-runtime-coverage-" });
646
+ //# sourceMappingURL=runtime-coverage.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-coverage.test.js","sourceRoot":"","sources":["../../../tests/e2e/runtime-coverage.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,GAAG,MAAM,CAAC;AAEvB,WAAW,CACT,kBAAkB,EAClB,CAAC,CAAC,EAAE,EAAE;IACJ,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDd,CAAC;QACF,MAAM,MAAM,GAAG,CAAC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