chore: unit test for pub in validator module warnings closes #681
This commit is contained in:
		
							parent
							
								
									abd18656e3
								
							
						
					
					
						commit
						78b0789cbc
					
				| 
						 | 
				
			
			@ -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]
 | 
			
		||||
fn validator_illegal_arity() {
 | 
			
		||||
    let source_code = r#"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue