Live runtime verification
Rust tests in this browser
Cargo compiled the same dependency-free Rust test inventory—the same seven #[test] functions used by the native CI lane, including Behavioral coverage—into wasm32-unknown-unknown. A separate host adapter checks passive page output and WebAssembly delivery.
Running…
Checking the page, loading WebAssembly, and running the Cargo-generated Rust test harness.
Checks running in this page
- Waiting for the browser test adapter
The named heading, target, and delivery rows are browser-host checks, not Rust tests. The final aggregate row calls the real Cargo-generated harness once; native Cargo and WASM execute the exact same seven Rust functions. Harness result: not run.
Exact boundary
What this browser path can test
| Layer | Supported | Not supported |
|---|---|---|
| Rust WASM | Target-compatible Rust logic in the same library #[test] functions; safe aggregate main() status. | JavaScript functions, DOM or console APIs, individual browser diagnostics, and OS- or thread-dependent tests. |
| Host adapter | One snapshot of connected, visible, nonempty rendered text with optional exact matching; fetch, MIME, instantiation, export, and status checks. | Clicks, typing, focus, navigation, arbitrary properties, custom network assertions, waits, or retries. |
This repository's module has zero host imports, and the browser supplies no import object. Test JavaScript functions directly in the JavaScript lane; this adapter can only observe text they rendered before browser.js started. See the complete browser contract.
Copy-ready example
A basic Rust suite
Put this in your crate's src/lib.rs. Native Cargo prints individual Rust test names and assertion diagnostics; cargo vanilla-test --browser compiles the same #[test] inventory into the deployable runner above.
#[cfg(test)]
mod tests {
use vanilla_test::VanillaTest;
#[test]
fn basic_suite() {
let mut test = VanillaTest::new();
test.expects("2 + 2 equals 4").unwrap();
if 2 + 2 == 4 {
test.pass().unwrap();
} else {
test.fail().unwrap();
}
test.done().unwrap();
test.expects("uppercase preserves the word").unwrap();
if "rust".to_uppercase() == "RUST" {
test.pass().unwrap();
} else {
test.fail().unwrap();
}
test.done().unwrap();
let result = test.report().unwrap();
assert!(result.ok, "{}", result.report);
assert_eq!(result.total, 2);
}
}cargo test
cargo vanilla-test --browserBare wasm32-unknown-unknown has no stdout host. The browser shows the host checks and the real Rust harness status; native Cargo prints each Rust test name and assertion diagnostic.
No wasm-bindgen, unsafe export, JavaScript copy of the Rust assertions, generated glue, or wrapper crate is involved.