forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a missing early-return in
Table::get
Turns out this was a typo from bytecodealliance#1016!
- Loading branch information
1 parent
c284ffe
commit 1a057f3
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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()); | ||
} |