chore: unit test for pub in validator module warnings closes #681

This commit is contained in:
microproofs 2023-11-22 18:02:21 -05:00
parent abd18656e3
commit 78b0789cbc
1 changed files with 19 additions and 0 deletions

View File

@ -66,6 +66,25 @@ fn validator_illegal_return_type() {
)) ))
} }
#[test]
fn validator_useless_pub() {
let source_code = r#"
type Datum {
thing: Int
}
validator {
pub fn foo(_d: Datum, _r, _c) {
True
}
}
"#;
let (warnings, _) = check_validator(parse(source_code)).unwrap();
assert!(matches!(warnings[0], Warning::PubInValidatorModule { .. }))
}
#[test] #[test]
fn validator_illegal_arity() { fn validator_illegal_arity() {
let source_code = r#" let source_code = r#"