WasmEdge-spectest is a repository of spec test data extracted from WebAssembly (WASM) test suites.
-
Test data is from WebAssembly Core Tests and tests from each proposal.
-
S-Expression scripts of tests are extracted into
jsonandwasmfiles by the wast2json tool in wabt. -
For WASM text formats not currently supported by wabt, parsing and conversion into binary files is done by wasm-tools.
-
For the Component Model tests, the
json-from-wastcommand of wasm-tools is used to extractjsonandwasmfiles.
wasm-1.0: The WASM 1.0 tests with the following proposal:wasm-2.0: The WASM 2.0 tests with WASM 1.0 and the following proposals:wasm-3.0prefixed folders: The WASM 3.0 tests with WASM 1.0, WASM 2.0, and the following proposals:threads: The tests for the Threads proposal.exception-handling-legacy: The legacy version of the Exception handling proposal tests.- This is deprecated.
component-model: The tests for the Component Model proposal.
wasm-core-20260316: The test suite dated 2026/03/16 from the WASM spec and proposalswasm-core-20260301: The test suite dated 2026/03/01 from the WASM spec and proposalswasm-core-20251216: The test suite dated 2025/12/16 from the WASM spec and proposalswasm-core-20251029: The test suite dated 2025/10/29 from the WASM spec and proposalswasm-core-20250217: The test suite dated 2025/02/17 from the WASM spec and proposals
- This repo was moved from the old spec test repo. For older tags and history, please refer to the WasmEdge-unittest repo.
wasm-core-20240217: The test suite dated 2024/02/17 from the WASM specwasm-core-20231026: The test suite dated 2023/10/26 from the WASM specwasm-core-20230511: The test suite dated 2023/05/11 from the WASM specwasm-core-20221215: The test suite dated 2022/12/15 from the WASM specwasm-core-20221026: The test suite dated 2022/10/26 from the WASM specwasm-core-20220712: The test suite dated 2022/07/12 from the WASM specwasm-core-20220504: The test suite dated 2022/05/04 from the WASM specwasm-core-20220223: The test suite dated 2022/02/23 from the WASM specwasm-core-20211214: The test suite dated 2021/12/14 from the WASM specwasm-core-20211119: The test suite dated 2021/11/19 from the WASM specwasm-core-20210414: The test suite dated 2021/04/14 from the WASM spec
wasm-2.0/select/select.wastline 325:invalid result arity->type mismatch- This error message is for the WAT format; the WASM format cannot detect this error from the bytecode.
wasm-3.0/select/select.wastline 369:invalid result arity->type mismatch- This error message is for the WAT format; the WASM format cannot detect this error from the bytecode.
- Updated error message text for older tests
- Changed
global is immutabletoimmutable globalaccording to the latest test suite.wasm-1.0/global/global.wastline 244wasm-2.0/global/global.wastline 274, 279
- Changed
wasm-3.0/instancefolder moved towasm-3.0-exceptions- Temporarily moved this test set to the exception handling folder until the exception-handling proposal implementation for AOT/JIT is completed in WasmEdge.
The following S-Expression constructs are not supported by wabt. Their corresponding .json and .wasm files are generated manually or by other tools, with new command types introduced in the JSON format.
A new "module_definition" type in the commands array. It has the same structure as "module" but represents a module definition that is not automatically instantiated.
- Structure:
{"type": "module_definition", "line": N, "filename": "X.wasm"} - Used in:
wasm-3.0/instance/instance.wastline 3, 109wasm-3.0/memory/memory.wastline 8wasm-3.0/table/table.wastline 9wasm-3.0-memory64/memory64/memory64.wastline 8wasm-3.0-memory64/table64/table64.wastline 9
A new "module_instance" type in the commands array. It has a similar structure to "register", but uses the "definition" field to reference the source module definition by name.
- Structure:
{"type": "module_instance", "line": N, "name": "$inst", "definition": "$def"} - Used in:
wasm-3.0/instance/instance.wastline 10, 11, 125
A new "thread" type for the Threads proposal test cases. It represents a concurrent thread of execution containing its own nested commands. Each module within a thread is compiled to a separate .wasm file.
- Structure:
{"type": "thread", "line": N, "name": "$T1", "shared": [...], "commands": [...]}"name": the thread identifier (e.g."$T1")."shared": an array of shared module references from the(shared (module $ref))clause. Each entry is{"module": "$ref"}. Empty array[]when the thread has nosharedclause."commands": a nested array of standard commands (module,register,action,assert_return,assert_unlinkable, or nestedthread, etc.) that execute within the thread.
- Used in:
threads/simple/simple.wastline 6threads/thread/thread.wastline 6, 17, 41threads/wait_notify/wait_notify.wastline 6, 19threads/LB/LB.wastline 6, 23threads/LB_atomic/LB_atomic.wastline 6, 23threads/MP/MP.wastline 6, 18threads/MP_atomic/MP_atomic.wastline 6, 18threads/SB/SB.wastline 6, 23threads/SB_atomic/SB_atomic.wastline 6, 23threads/nested/nested.wastline 7, 21, 36threads/deeply_nested/deeply_nested.wastline 8, 22, 33, 42, 52, 75threads/unlinkable/unlinkable.wastline 5, 14
A new "wait" type for the Threads proposal test cases. It blocks execution until the referenced thread completes.
- Structure:
{"type": "wait", "line": N, "thread": "$T1"}"thread": the name of the thread to wait on.
- Used in:
threads/simple/simple.wastline 18threads/thread/thread.wastline 28, 29, 48threads/wait_notify/wait_notify.wastline 39, 40threads/LB/LB.wastline 41, 42threads/LB_atomic/LB_atomic.wastline 41, 42threads/MP/MP.wastline 38, 39threads/MP_atomic/MP_atomic.wastline 38, 39threads/SB/SB.wastline 41, 42threads/SB_atomic/SB_atomic.wastline 41, 42threads/nested/nested.wastline 32, 53, 54threads/deeply_nested/deeply_nested.wastline 63, 64, 70, 71, 92, 93threads/unlinkable/unlinkable.wastline 12, 21
A new "either" type used in the "expected" array of "assert_return" for non-deterministic results in concurrent tests. It indicates the actual result may be any one of the provided alternatives.
- Structure:
{"type": "either", "values": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "42"}]} - Used in:
threads/thread/thread.wastline 25
- Removed tests from the old spec
component-model/import/import.wastline 345
- Trap message modifications for component-model tests (WasmEdge/WasmEdge#4666):
component-model/adapt/adapt.wastline 81:canonical encoding option `utf8` conflicts with option `utf16`->canonical encoding option conflictscomponent-model/adapt/adapt.wastline 88:canonical encoding option `utf8` conflicts with option `latin1-utf16`->canonical encoding option conflictscomponent-model/adapt/adapt.wastline 95:canonical encoding option `utf16` conflicts with option `latin1-utf16`->canonical encoding option conflictscomponent-model/adapt/adapt.wastline 111:`memory` is specified more than once->canonical option `memory` is specified more than oncecomponent-model/adapt/adapt.wastline 255:unknown instance: failed to find name `$i`->unknown instancecomponent-model/adapt/adapt.wastline 263:lowered parameter types `[]` do not match parameter types `[I32]`->lowered parameter types do not match parameter typescomponent-model/adapt/adapt.wastline 271:lowered result types `[]` do not match result types `[I32]`->lowered result types do not match result typescomponent-model/adapt/adapt.wastline 287:unknown core func: failed to find name `$f`->unknown core funccomponent-model/alias/alias.wastline 114, 124:export `a` for instance 0 is not a module->alias unknown export modulecomponent-model/alias/alias.wastline 132, 140:core instance 0 has no export named `a`->alias unknown export namecomponent-model/alias/alias.wastline 148:instance 0 has no export named `a`->alias unknown export namecomponent-model/alias/alias.wastline 263, 271, 279:invalid outer alias count of 100->invalid outer alias countcomponent-model/definedtypes/definedtypes.wastline 60, 67, 74:type index 0 is not a defined type->not a defined typecomponent-model/definedtypes/definedtypes.wastline 97:record field name `A-b-C-d` conflicts with previous field name `a-B-c-D`->record field name conflicts with previous field namecomponent-model/definedtypes/definedtypes.wastline 100:variant case name `x` conflicts with previous case name `x`->variant case name conflicts with previous case namecomponent-model/definedtypes/definedtypes.wastline 103:flag name `X` conflicts with previous flag name `x`->flag name conflicts with previous flag namecomponent-model/definedtypes/definedtypes.wastline 106:enum tag name `X` conflicts with previous tag name `x`->enum tag name conflicts with previous tag namecomponent-model/export-ascription/export-ascription.wastline 44:missing expected export `f`->missing expected exportcomponent-model/func/func.wastline 21:function parameter name `FOO` conflicts with previous parameter name `foo`->function parameter name conflicts with previous parameter namecomponent-model/import/import.wastline 24:type index 0 is not an instance type->unknown instance typecomponent-model/import/import.wastline 31:core type index 0 is not a module type->unknown module typecomponent-model/import/import.wastline 38:type index 0 is not a function type->unknown function typecomponent-model/import/import.wastline 48, 56:duplicate import name `:`->duplicate import namecomponent-model/import/import.wastline 64, 72:duplicate import name `:a`->duplicate import namecomponent-model/import/import.wastline 79, 88:import name `a` conflicts with previous name `a`->import name conflicts with previous namecomponent-model/import/import.wastline 126, 129, 202, 205, 208, 211, 214, 240, 243, 246, 249, 252:`` is not in kebab case->not in kebab casecomponent-model/import/import.wastline 138:`wasi/http` is not in kebab case->not in kebab casecomponent-model/import/import.wastline 141:`TyPeS` is not in kebab case->not in kebab casecomponent-model/import/import.wastline 144:`WaSi` is not in kebab case->not in kebab casecomponent-model/import/import.wastline 147:`HtTp` is not in kebab case->not in kebab casecomponent-model/import/import.wastline 153:unexpected character '.'->unexpected charactercomponent-model/import/import.wastline 159:unexpected character 'a'->unexpected charactercomponent-model/import/import.wastline 162:unexpected character 'b'->unexpected charactercomponent-model/import/import.wastline 165:unexpected character 'x'->unexpected charactercomponent-model/import/import.wastline 177:trailing characters found: `/qux`->trailing characters foundcomponent-model/import/import.wastline 199, 237, 277:expected `<` at->expected<``component-model/import/import.wastline 217:expected `{` at `>`->expected `{`component-model/import/import.wastline 223:`xyz` is not a valid semver->not a valid semvercomponent-model/import/import.wastline 226:`1.2.3 >=2.3.4` is not a valid semver->not a valid semvercomponent-model/import/import.wastline 255, 261:expected `>` at ``->expected `>`component-model/import/import.wastline 267:trailing characters found: `x`->trailing characters foundcomponent-model/instance-types/instance-type.wastline 185:export name `a` conflicts with previous name `a`->export name conflicts with previous namecomponent-model/instance-types/instance-type.wastline 193:type index 0 is not an instance type->not an instance typecomponent-model/instance-types/instance-type.wastline 201:core type index 0 is not a module type->not a module typecomponent-model/instance-types/instance-type.wastline 216, 224, 234:type index 0 is not a function type->not a function typecomponent-model/instantiate/instantiate.wastline 168:missing import named `a`->missing importcomponent-model/instantiate/instantiate.wastline 178, 479:expected func, found component->expected funccomponent-model/instantiate/instantiate.wastline 188:expected a result, found none->expected a resultcomponent-model/instantiate/instantiate.wastline 198:expected 0 parameters, found 1->type mismatch in function typecomponent-model/instantiate/instantiate.wastline 212:type mismatch in import `::`->type mismatch in importcomponent-model/instantiate/instantiate.wastline 224:missing expected import `::foobar`->missing expected importcomponent-model/instantiate/instantiate.wastline 233:missing expected export `x`->missing expected exportcomponent-model/instantiate/instantiate.wastline 308:expected global type i32, found i64->type mismatch in global typecomponent-model/instantiate/instantiate.wastline 316:expected table element type funcref, found externref->type mismatch in table element typecomponent-model/instantiate/instantiate.wastline 365:type mismatch in export `g`->type mismatch in exportcomponent-model/instantiate/instantiate.wastline 436, 448:duplicate module instantiation argument named ``->duplicate module instantiation argumentcomponent-model/instantiate/instantiate.wastline 459:expected global, found func->expected globalcomponent-model/instantiate/instantiate.wastline 470:instantiation argument `a` conflicts with previous argument `a`->instantiation argument conflicts with previous argumentcomponent-model/instantiate/instantiate.wastline 525:export name `a` conflicts with previous name `a`->export name conflicts with previous namecomponent-model/instantiate/instantiate.wastline 567:export name `` already defined->duplicate export namecomponent-model/instantiate/instantiate.wastline 575:no export named `a`->unknown exportcomponent-model/instantiate/instantiate.wastline 613:module instantiation argument `` does not export an item named `table`->module instantiation argument unknown exportcomponent-model/instantiate/instantiate.wastline 642:expected primitive `u32` found primitive `string`->primitive mismatchcomponent-model/instantiate/instantiate.wastline 691:expected parameter named `y`, found `x`->type mismatch in function parametercomponent-model/instantiate/instantiate.wastline 701:type mismatch in function parameter `x`->type mismatch in function parametercomponent-model/instantiate/instantiate.wastline 711:type mismatch with result type->type mismatch in result typecomponent-model/instantiate/instantiate.wastline 722:type mismatch in instance export `a`->type mismatch in instance exportcomponent-model/instantiate/instantiate.wastline 734:expected primitive, found record->type mismatchcomponent-model/instantiate/instantiate.wastline 746:expected record, found u32->type mismatchcomponent-model/instantiate/instantiate.wastline 759:expected u32, found tuple->type mismatchcomponent-model/instantiate/instantiate.wastline 772:type mismatch in record field `x`->type mismatchcomponent-model/instantiate/instantiate.wastline 784:expected 1 fields, found 2->type mismatchcomponent-model/instantiate/instantiate.wastline 796:expected field name `a`, found `b`->type mismatch in record fieldcomponent-model/instantiate/instantiate.wastline 808:expected 1 cases, found 2->type mismatchcomponent-model/instantiate/instantiate.wastline 820:expected case named `x`, found `y`->type mismatch in variant casecomponent-model/instantiate/instantiate.wastline 832:expected case `x` to have a type, found none->type mismatch in variant casecomponent-model/instantiate/instantiate.wastline 844:expected case `x` to have no type->type mismatch in variant casecomponent-model/instantiate/instantiate.wastline 856:type mismatch in variant case `x`->type mismatch in variant casecomponent-model/instantiate/instantiate.wastline 868:expected 1 types, found 2->type mismatch in tuple fieldcomponent-model/instantiate/instantiate.wastline 880:type mismatch in tuple field 0->type mismatch in tuple fieldcomponent-model/instantiate/instantiate.wastline 892:mismatch in flags elements->type mismatch in flags elementscomponent-model/instantiate/instantiate.wastline 952:expected ok type, but found none->type mismatch in result typecomponent-model/instantiate/instantiate.wastline 976:expected err type, but found none->type mismatch in result typecomponent-model/invalid/invalid.wastline 22:outer count of `100` is too large->outer count is too largecomponent-model/invalid/invalid.wastline 28:outer component `nonexistent` not found->outer component not foundcomponent-model/invalid/invalid.wastline 34:outer item `x` is not a module, type, or component->outer item is not a module, type, or componentcomponent-model/naming/naming.wastline 14:`1` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 22:instance 0 has no export named `Xml`->unknown exportcomponent-model/naming/naming.wastline 33:enum tag name `NevEr` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 40:record field name `GoNnA` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 47:variant case name `GIVe` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 55:function parameter name `yOu` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 62:`NevEr` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 69:`GonnA` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 76:`lET` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 83:`YoU` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 90:`DOWn` is not in kebab case->not in kebab casecomponent-model/naming/naming.wastline 97:character `A` is not lowercase in package name/namespace->not lowercase in package name/namespacecomponent-model/naming/naming.wastline 103:character `B` is not lowercase in package name/namespace->not lowercase in package name/namespacecomponent-model/naming/naming.wastline 120:import name `[method]a.a` conflicts with previous name `a`->import name conflicts with previous namecomponent-model/naming/naming.wastline 127:import name `[static]a.a` conflicts with previous name `a`->import name conflicts with previous namecomponent-model/resources/resources.wastline 499:expected resource, found defined type->expected resourcecomponent-model/resources/resources.wastline 510:expected defined type, found resource->expected defined typecomponent-model/resources/resources.wastline 750:missing import named `x`->missing importcomponent-model/resources/resources.wastline 760:missing import named `y`->missing importcomponent-model/resources/resources.wastline 849:expected component, found instance->expected componentcomponent-model/resources/resources.wastline 870:type mismatch for import `y`->type mismatch for importcomponent-model/resources/resources.wastline 915:import name `[constructor]a` is not valid->import name is not validcomponent-model/resources/resources.wastline 920, 925, 1050:function does not match expected resource name `b`->function does not match expected resource namecomponent-model/tags/tags.wastline 9:export `` for core instance 0 is not a tag->unknown tagcomponent-model/tags/tags.wastline 30:unknown tag 0->unknown tagcomponent-model/types/types.wastline 8, 49:type index 0 is not a function type->unknown function typecomponent-model/types/types.wastline 15, 40:core type index 0 is not a module type->unknown module typecomponent-model/types/types.wastline 22, 31:type index 0 is not an instance type->unknown instance typecomponent-model/types/types.wastline 78:export name `a` already defined->duplicate export namecomponent-model/types/types.wastline 112:export name `A` conflicts with previous name `a`->conflicts with previous export namecomponent-model/types/types.wastline 121:import name `a` conflicts with previous name `A`->conflicts with previous import namecomponent-model/types/types.wastline 165, 217:invalid outer alias count of 100->invalid outer alias countcomponent-model/types/types.wastline 177, 229:name `` already defined->duplicate export namecomponent-model/types/types.wastline 194:export name `FOO-bar-BAZ` conflicts with previous name `foo-BAR-baz`->conflicts with previous export namecomponent-model/types/types.wastline 368:type index 0 is a module type->unknown module type