Added traps tests

This commit is contained in:
Syrus
2020-06-08 19:13:13 -07:00
parent e9a234b364
commit b57bbb1256
5 changed files with 478 additions and 7 deletions

View File

@@ -176,18 +176,14 @@ impl Function {
let signature = self.ty();
if signature.params().len() != params.len() {
return Err(RuntimeError::new(format!(
"expected {} arguments, got {}: Parameters of type [{}] did not match signature {}",
signature.params().len(),
params.len(),
"Parameters of type [{}] did not match signature {}",
format_types_for_error_message(params),
&signature
)));
}
if signature.results().len() != results.len() {
return Err(RuntimeError::new(format!(
"expected {} results, got {}: Results of type [{}] did not match signature {}",
signature.results().len(),
results.len(),
"Results of type [{}] did not match signature {}",
format_types_for_error_message(results),
&signature,
)));