mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-11 10:52:49 +03:00
add test for returning tuples from function
This commit is contained in:
parent
37944ed571
commit
789a744deb
@ -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);
|
||||
}
|
||||
|
11
compiler/tests/function/return_tuple.leo
Normal file
11
compiler/tests/function/return_tuple.leo
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user