Files
wasmtime/tests/all/table.rs
Alex Crichton 6ef106fee9 Fix a missing early-return in Table::get (#1652)
Turns out this was a typo from #1016!
2020-05-04 15:19:37 -05:00

14 lines
360 B
Rust

use wasmtime::*;
#[test]
fn get_none() {
let store = Store::default();
let ty = TableType::new(ValType::FuncRef, Limits::new(1, None));
let table = Table::new(&store, ty, Val::AnyRef(AnyRef::Null)).unwrap();
match table.get(0) {
Some(Val::AnyRef(AnyRef::Null)) => {}
_ => panic!(),
}
assert!(table.get(1).is_none());
}