add test to check for stack overflow

This commit is contained in:
collin 2020-08-17 01:30:13 -07:00
parent 6631da0c7e
commit 5bd2575fd5
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,3 @@
function main() {
let a = -5i8 > 342u32;
}

View File

@ -54,3 +54,12 @@ fn input_syntax_error() {
_ => panic!("input syntax error should be a ParserError"),
}
}
#[test]
fn test_compare_mismatched_types() {
let bytes = include_bytes!("compare_mismatched_types.leo");
let program = parse_program(bytes).unwrap();
// previously this bug caused a stack overflow
expect_compiler_error(program);
}