add test for bug #427 incomplete conditional

This commit is contained in:
collin 2020-12-03 13:44:47 -05:00
parent dfcc77a860
commit 87c0dd738a
2 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,14 @@ fn test_multiple_returns_fail() {
expect_compiler_error(program); expect_compiler_error(program);
} }
#[test]
fn test_multiple_returns_fail_conditional() {
let bytes = include_bytes!("multiple_returns_fail_conditional.leo");
let program = parse_program(bytes).unwrap();
expect_compiler_error(program);
}
#[test] #[test]
fn test_multiple_returns_main() { fn test_multiple_returns_main() {
let program_bytes = include_bytes!("multiple_returns_main.leo"); let program_bytes = include_bytes!("multiple_returns_main.leo");

View File

@ -0,0 +1,9 @@
function main () -> u16 {
if false {
let a = 1u16;
let b = a + 1u16;
return b
} else if false {
return 0u16
}
}