mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 15:41:36 +03:00
add test for returning a tuple in a conditional statement
This commit is contained in:
parent
c27a166dfb
commit
093bab6b02
@ -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);
|
||||
}
|
||||
|
15
compiler/tests/function/return_tuple_conditional.leo
Normal file
15
compiler/tests/function/return_tuple_conditional.leo
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user