add test for returning a tuple in a conditional statement

This commit is contained in:
collin 2020-11-18 18:28:41 -08:00
parent c27a166dfb
commit 093bab6b02
2 changed files with 23 additions and 0 deletions

View File

@ -174,3 +174,11 @@ fn test_return_array_tuple_pass() {
assert_satisfied(program);
}
#[test]
fn test_return_tuple_conditional() {
let bytes = include_bytes!("return_tuple_conditional.leo");
let program = parse_program(bytes).unwrap();
assert_satisfied(program);
}

View File

@ -0,0 +1,15 @@
// Returns a tuple using a conditional "if" statement.
function tuple_conditional () -> (
i64,
i64
) {
if true {
return (1, 1)
} else {
return (2, 2)
}
}
function main() {
let t = tuple_conditional();
}