mirror of
https://github.com/denoland/deno.git
synced 2024-11-27 16:10:57 -05:00
chore(check): add test for Wasm memory and table (#26996)
This commit is contained in:
parent
5ca47ee97a
commit
9c0e6369b2
4 changed files with 29 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
tests/specs/run/wasm_module/table_global_memory/check.out
Normal file
14
tests/specs/run/wasm_module/table_global_memory/check.out
Normal file
|
@ -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.
|
4
tests/specs/run/wasm_module/table_global_memory/check.ts
Normal file
4
tests/specs/run/wasm_module/table_global_memory/check.ts
Normal file
|
@ -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);
|
|
@ -1,4 +1,3 @@
|
|||
Check [WILDCARD]
|
||||
[Module: null prototype] {
|
||||
func: [Function: 0],
|
||||
global: Global [WebAssembly.Global] {},
|
||||
|
|
Loading…
Reference in a new issue