chore: add test for validator args with no annotation
This commit is contained in:
parent
f14bab69c0
commit
ad4840958c
|
@ -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#"
|
||||||
|
|
Loading…
Reference in New Issue