use std::sync::Arc;
use tensor_wasm_core::types::TenantId;
use tensor_wasm_exec::engine::TensorWasmEngine;
use tensor_wasm_exec::executor::{ExecError, SpawnConfig, TensorWasmExecutor};
#[tokio::test]
async fn memory64_module_is_rejected() {
let wat = r#"(module (memory i64 1))"#;
let wasm = wat::parse_str(wat).expect("wat assembles fine — the bytes are syntactically valid; we expect wasmtime to reject them based on the pinned proposal flags");
let engine = Arc::new(TensorWasmEngine::new().expect("engine"));
let exec = TensorWasmExecutor::new(engine);
let err = exec
.spawn_instance(SpawnConfig::for_tenant(TenantId(1)), &wasm)
.await
.expect_err(
"memory64 must be rejected because wasm_memory64(false) is \
pinned in TensorWasmEngine::with_config — if this assertion \
starts failing, the deny-list has regressed and the \
multi-tenant sandbox trust model is no longer enforced",
);
match err {
ExecError::Wasmtime(_) => {}
other => panic!(
"expected ExecError::Wasmtime rejecting the memory64 module, \
got {other:?}"
),
}
}