Lines
100 %
Functions
Branches
//! Tests for the closure emit guards.
use super::*;
#[test]
fn a_helper_naming_a_local_outside_its_pool_is_a_compile_error() {
let mut emit = FunctionEmitter::new();
emit.local_get(7);
let owned = [(1, ValType::I32)];
assert!(matches!(
reject_foreign_locals(&emit, 1, &owned),
Err(Error::Compile(_))
));
let mut own = FunctionEmitter::new();
own.local_get(1);
assert!(reject_foreign_locals(&own, 1, &owned).is_ok());
}