add test for returning tuples from function

This commit is contained in:
collin 2020-11-18 18:13:49 -08:00
parent 37944ed571
commit 789a744deb
2 changed files with 21 additions and 0 deletions

View File

@ -174,3 +174,13 @@ fn test_return_array_tuple_pass() {
assert_satisfied(program);
}
// Test return tuples
#[test]
fn test_return_tuple() {
let bytes = include_bytes!("return_tuple.leo");
let program = parse_program(bytes).unwrap();
assert_satisfied(program);
}

View File

@ -0,0 +1,11 @@
// Returns a tuple of tuples.
function tuples() -> ((u8, u8), u32) {
let a: (u8, u8) = (1, 2);
let b: u32 = 3;
return (a, b)
}
function main() {
let t = tuples();
}