mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-03-15 03:00:49 +00:00
add much more complicated assertion
This commit is contained in:
parent
0a78a1ab8d
commit
cda99e70da
15
src/graph.rs
15
src/graph.rs
@ -869,6 +869,7 @@ mod tests {
|
|||||||
|
|
||||||
{
|
{
|
||||||
let type_ref_0 = sample.types.clone_ref(0);
|
let type_ref_0 = sample.types.clone_ref(0);
|
||||||
|
let declared_func_2 = sample.funcs.clone_ref(2);
|
||||||
|
|
||||||
let mut tx = sample.funcs.begin_insert_not_until(
|
let mut tx = sample.funcs.begin_insert_not_until(
|
||||||
|f| match f.origin {
|
|f| match f.origin {
|
||||||
@ -885,6 +886,20 @@ mod tests {
|
|||||||
tx.done();
|
tx.done();
|
||||||
|
|
||||||
assert_eq!(new_import_func.order(), Some(1));
|
assert_eq!(new_import_func.order(), Some(1));
|
||||||
|
assert_eq!(declared_func_2.order(), Some(3));
|
||||||
|
assert_eq!(
|
||||||
|
match &declared_func_2.read().origin {
|
||||||
|
super::ImportedOrDeclared::Declared(ref body) => {
|
||||||
|
match body.code[1] {
|
||||||
|
super::Instruction::Call(ref called_func) => called_func.order(),
|
||||||
|
_ => panic!("instruction #2 should be a call!"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => panic!("func #4 should be declared!"),
|
||||||
|
},
|
||||||
|
Some(2),
|
||||||
|
"Call should be recalculated to 2"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_sample(&sample);
|
validate_sample(&sample);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user