Files
wasmtime/tests/all/table.rs
2020-05-20 11:58:55 -07:00

14 lines
372 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::ExternRef(ExternRef::Null)).unwrap();
match table.get(0) {
Some(Val::ExternRef(ExternRef::Null)) => {}
_ => panic!(),
}
assert!(table.get(1).is_none());
}