chore: add test for validator args with no annotation

This commit is contained in:
rvcas 2024-03-06 11:19:27 -05:00
parent f14bab69c0
commit ad4840958c
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
1 changed files with 27 additions and 0 deletions

View File

@ -240,6 +240,33 @@ fn exhaustiveness_simple() {
)) ))
} }
#[test]
fn validator_args_no_annotation() {
let source_code = r#"
validator(d) {
fn foo(a, b, c) {
True
}
}
"#;
let (_, module) = check_validator(parse(source_code)).unwrap();
module.definitions().for_each(|def| {
let Definition::Validator(validator) = def else {
unreachable!()
};
validator.params.iter().for_each(|param| {
assert!(param.tipo.is_data());
});
validator.fun.arguments.iter().for_each(|arg| {
assert!(arg.tipo.is_data());
})
})
}
#[test] #[test]
fn exhaustiveness_missing_empty_list() { fn exhaustiveness_missing_empty_list() {
let source_code = r#" let source_code = r#"