mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 10:41:57 +03:00
Add test case
This commit is contained in:
parent
91db5c3b8a
commit
387db2e321
25
tests/compiler/tuple/function_call_returns_tuple.leo
Normal file
25
tests/compiler/tuple/function_call_returns_tuple.leo
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
function foo(a: u8, b: u8) -> (u8, u8) {
|
||||
if (a == b) {
|
||||
return (a, b);
|
||||
}
|
||||
let c: u8 = a + b;
|
||||
let d: u8 = a - b;
|
||||
return (c, d);
|
||||
}
|
||||
|
||||
transition bar(flag: bool, a: u8, b: u8) -> (u8, u8) {
|
||||
let start: (u8, u8) = foo(a, b);
|
||||
if flag {
|
||||
start = foo(start.0, start.1);
|
||||
} else {
|
||||
start = foo(start.1, start.0);
|
||||
}
|
||||
return start;
|
||||
}
|
||||
}
|
@ -13,4 +13,5 @@ program test.aleo {
|
||||
let c: u8 = a + b;
|
||||
let d: u8 = a - b;
|
||||
return (c, d);
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user