complicate test

This commit is contained in:
NikVolf 2019-01-24 14:35:05 +03:00
parent 33c84edd78
commit 0a78a1ab8d

View File

@ -368,6 +368,8 @@ impl Module {
}, },
_ => unreachable!("All declared functions added after imported; qed"), _ => unreachable!("All declared functions added after imported; qed"),
} }
idx += 1;
} }
}, },
elements::Section::Data(data_section) => { elements::Section::Data(data_section) => {
@ -858,6 +860,10 @@ mod tests {
call 0 call 0
drop drop
) )
(func (type 0)
i32.const 0
call 1
)
)"# )"#
); );
@ -866,17 +872,19 @@ mod tests {
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 {
super::ImportedOrDeclared::Imported(_, _) => false, super::ImportedOrDeclared::Imported(_, _) => true,
_ => true, _ => false,
} }
); );
tx.push(super::Func { let new_import_func = tx.push(super::Func {
type_ref: type_ref_0, type_ref: type_ref_0,
origin: super::ImportedOrDeclared::Imported("env".to_owned(), "bar".to_owned()), origin: super::ImportedOrDeclared::Imported("env".to_owned(), "bar".to_owned()),
}); });
tx.done(); tx.done();
assert_eq!(new_import_func.order(), Some(1));
} }
validate_sample(&sample); validate_sample(&sample);