-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(check): add test for Wasm memory and table (#26996)
- Loading branch information
1 parent
9236786
commit 1030cae
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
13 changes: 11 additions & 2 deletions
13
tests/specs/run/wasm_module/table_global_memory/__test__.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
{ | ||
"args": "run --check main.js", | ||
"output": "main.out" | ||
"tests": { | ||
"run": { | ||
"args": "run main.js", | ||
"output": "main.out" | ||
}, | ||
"check": { | ||
"args": "check check.ts", | ||
"output": "check.out", | ||
"exitCode": 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Check file:///[WILDLINE]/check.ts | ||
error: TS2322 [ERROR]: Type 'Function | null' is not assignable to type 'number'. | ||
Type 'null' is not assignable to type 'number'. | ||
const value1: number = table.get(0); | ||
~~~~~~ | ||
at file:///[WILDLINE]/check.ts:2:7 | ||
|
||
TS2322 [ERROR]: Type 'ArrayBuffer | SharedArrayBuffer' is not assignable to type 'number'. | ||
Type 'ArrayBuffer' is not assignable to type 'number'. | ||
const value2: number = memory.buffer; | ||
~~~~~~ | ||
at file:///[WILDLINE]/check.ts:3:7 | ||
|
||
Found 2 errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { memory, table } from "./mod.wasm"; | ||
const value1: number = table.get(0); | ||
const value2: number = memory.buffer; | ||
console.log(value1, value2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Check [WILDCARD] | ||
[Module: null prototype] { | ||
func: [Function: 0], | ||
global: Global [WebAssembly.Global] {}, | ||
|