Skip to content

Testing

Counts vary by feature flags; the async-runtime suite is only compiled when async-runtime is enabled.

LocationCountCoverage
ion-core/tests/integration.rs~462Tree-walk interpreter, stdlib, host types, register_closure
ion-core/tests/cross_validate.rs~205Tree-walk ↔ VM parity
ion-core/tests/vm.rs~161VM-specific behavior
ion-core/tests/async_runtime.rs~129async-runtime native Tokio eval, host futures, timers, channels, callbacks
ion-core/tests/integration_async.rs~14End-to-end stdlib coverage under Engine::eval_async
ion-core/tests/edge_cases.rs~65Adversarial/edge cases
ion-core/tests/legacy_threaded_concurrency.rs17Legacy legacy-threaded-concurrency OS-thread sync-eval backend
ion-core/src/ (unit tests)~28Lexer, parser, hash, log, names, and stdlib manifest checks
Doctests2+Public crate examples
fn assert_both_eq(src: &str, expected: Value) {
let tw_val = Engine::new().eval(src).unwrap();
let vm_val = Engine::new().vm_eval(src).unwrap();
assert_eq!(tw_val, expected);
assert_eq!(vm_val, expected);
}
Terminal window
RUST_MIN_STACK=16777216 cargo test --workspace --all-features # everything enabled
cargo test --all-features -p ion-core --test cross_validate # just parity
cargo test -p ion-core --features async-runtime --test async_runtime # native async runtime
cargo test -p ion-core --no-default-features --features legacy-threaded-concurrency --test legacy_threaded_concurrency
cargo test --all-features -p ion-core --test integration register_closure # by name
cargo clippy --all-features --all-targets -- -D warnings
cargo fmt --all -- --check

Example binaries are compiled by cargo test when their required features are active:

  • cargo run --example embed -p ion-core — basic embedding
  • cargo run --example tokio_host -p ion-core --features async-runtime — native Tokio async host
  • test: cargo test --workspace --all-features
  • clippy: --all-features --all-targets -- -D warnings
  • fmt: cargo fmt --all -- --check
  • build-lsp: cargo build -p ion-lsp --release
  • ion-core/fuzz/ directory (excluded from workspace)

Documentation reflects Ion v0.2.0-66-g3faa376.