16 unstable releases (4 breaking)

new 0.5.1 Mar 6, 2025
0.4.5 Feb 28, 2025
0.4.0 Dec 28, 2024
0.2.2 Mar 1, 2024
0.2.0 Dec 15, 2023

#1115 in Parser implementations

Download history 112/week @ 2024-11-30 570/week @ 2024-12-07 102/week @ 2024-12-14 50/week @ 2024-12-21 177/week @ 2024-12-28 145/week @ 2025-01-04 86/week @ 2025-01-11 104/week @ 2025-01-18 118/week @ 2025-01-25 30/week @ 2025-02-01 127/week @ 2025-02-08 43/week @ 2025-02-15 168/week @ 2025-02-22 402/week @ 2025-03-01

747 downloads per month

Apache-2.0

25MB
416K SLoC

WebAssembly 416K SLoC // 0.0% comments Rust 250 SLoC // 0.0% comments

wasm-testsuite

This repository contains copies of the WebAssembly Test Suite for all WebAssembly versions and proposals (even those that are now part of the spec).

Older tests have been ported to newer versions of the wast file format, and some tests have been modified to not fail due to relaxed validation rules in later versions.

Rust Crate

All tests are also available as a Rust crate, wasm-testsuite, which provides utilities for iterating over the tests and parsing the wast files.

crates.io docs.rs

Tests cases and the wast version can change between minor versions of this crate as new tests are added or existing tests are modified, so be sure to pin the version of this crate in your Cargo.toml (e.g. wasm-testsuite = "=0.4.4").

Usage

use wasm_testsuite::data::{Proposal, SpecVersion, proposal, spec};

fn main() -> eyre::Result<()> {
    for test in spec(&SpecVersion::V2) {
        let name = test.name();
        let raw = test.raw();
        let wast_directives = test.wast()?.directives();
    }

    for p in Proposal::all() {
        for test in proposal(p) {
            let name = test.name();
            let raw = test.raw();
            let wast_directives = test.wast()?.directives();
        }
    }

    Ok(())
}

License

This crate is licensed under the Apache License, Version 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in wasm-testsuite by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Note: The tests contained in data/ are from the WebAssembly Test Suite and are licensed under the Apache License, Version 2.0 as well.

Dependencies

~5.5MB
~103K SLoC