-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_list_concat.mjs
More file actions
18 lines (15 loc) · 675 Bytes
/
Copy pathtest_list_concat.mjs
File metadata and controls
18 lines (15 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: MIT OR AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2026 hyperpolymath
//
// Regression: `++` list concatenation must actually concatenate.
// Pre-fix this returned 0 (OpConcat was a placeholder I32Add).
import { readFile } from 'fs/promises';
const wasmBuffer = await readFile('./tests/codegen/list_concat.wasm');
const { instance } = await WebAssembly.instantiate(wasmBuffer, {
wasi_snapshot_preview1: { fd_write: () => 0 },
});
const result = instance.exports.main();
console.log(`Result: ${result}`);
console.log('Expected: 166');
console.log(`Test ${result === 166 ? 'PASSED ✓' : 'FAILED ✗'}`);
process.exit(result === 166 ? 0 : 1);