From 3d2d891d7e1492d179cd8da7a618fbdd5efcca2c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 16 Mar 2024 20:41:50 +0900 Subject: feat: add spec testsuites --- tests/fixtures/spec_testsuites/core/table_get.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/fixtures/spec_testsuites/core/table_get.json (limited to 'tests/fixtures/spec_testsuites/core/table_get.json') diff --git a/tests/fixtures/spec_testsuites/core/table_get.json b/tests/fixtures/spec_testsuites/core/table_get.json new file mode 100644 index 0000000..0e4a9e5 --- /dev/null +++ b/tests/fixtures/spec_testsuites/core/table_get.json @@ -0,0 +1,18 @@ +{"source_filename": "./table_get.wast", + "commands": [ + {"type": "module", "line": 1, "filename": "table_get.0.wasm"}, + {"type": "action", "line": 24, "action": {"type": "invoke", "field": "init", "args": [{"type": "externref", "value": "1"}]}, "expected": []}, + {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "get-externref", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "externref", "value": "null"}]}, + {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "get-externref", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "externref", "value": "1"}]}, + {"type": "assert_return", "line": 29, "action": {"type": "invoke", "field": "get-funcref", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "funcref", "value": "null"}]}, + {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "is_null-funcref", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 31, "action": {"type": "invoke", "field": "is_null-funcref", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_trap", "line": 33, "action": {"type": "invoke", "field": "get-externref", "args": [{"type": "i32", "value": "2"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, + {"type": "assert_trap", "line": 34, "action": {"type": "invoke", "field": "get-funcref", "args": [{"type": "i32", "value": "3"}]}, "text": "out of bounds table access", "expected": [{"type": "funcref"}]}, + {"type": "assert_trap", "line": 35, "action": {"type": "invoke", "field": "get-externref", "args": [{"type": "i32", "value": "4294967295"}]}, "text": "out of bounds table access", "expected": [{"type": "externref"}]}, + {"type": "assert_trap", "line": 36, "action": {"type": "invoke", "field": "get-funcref", "args": [{"type": "i32", "value": "4294967295"}]}, "text": "out of bounds table access", "expected": [{"type": "funcref"}]}, + {"type": "assert_invalid", "line": 42, "filename": "table_get.1.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 51, "filename": "table_get.2.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 61, "filename": "table_get.3.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 70, "filename": "table_get.4.wasm", "text": "type mismatch", "module_type": "binary"}, + {"type": "assert_invalid", "line": 80, "filename": "table_get.5.wasm", "text": "type mismatch", "module_type": "binary"}]} -- cgit v1.2.3-70-g09d2