mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 15:15:47 +03:00
added more tests
This commit is contained in:
parent
3f890c9f30
commit
42f58ff33e
19
tests/compiler/statements/reverse_loops.leo
Normal file
19
tests/compiler/statements/reverse_loops.leo
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
namespace: Compile
|
||||||
|
expectation: Pass
|
||||||
|
input_file: inputs/dummy.in
|
||||||
|
*/
|
||||||
|
|
||||||
|
function main(k: bool) -> bool {
|
||||||
|
let reverse: u32 = 0;
|
||||||
|
for i in 25..1 {
|
||||||
|
reverse += i;
|
||||||
|
}
|
||||||
|
|
||||||
|
let reverse_inclusive: u32 = 0;
|
||||||
|
for a in 25..=1 {
|
||||||
|
reverse_inclusive += a;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (reverse + 1 == reverse_inclusive) && k;
|
||||||
|
}
|
19
tests/compiler/statements/reverse_one.leo
Normal file
19
tests/compiler/statements/reverse_one.leo
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
namespace: Compile
|
||||||
|
expectation: Pass
|
||||||
|
input_file: inputs/dummy.in
|
||||||
|
*/
|
||||||
|
|
||||||
|
function main(k: bool) -> bool {
|
||||||
|
let reverse: u32 = 0;
|
||||||
|
for i in 1..0 {
|
||||||
|
reverse += i;
|
||||||
|
}
|
||||||
|
|
||||||
|
let reverse_inclusive: u32 = 0;
|
||||||
|
for a in 1..=0 {
|
||||||
|
reverse_inclusive += a;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (reverse == 1) && (reverse_inclusive == 1) && k;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
namespace: Compile
|
||||||
|
expectation: Pass
|
||||||
|
outputs:
|
||||||
|
- circuit:
|
||||||
|
num_public_variables: 0
|
||||||
|
num_private_variables: 1
|
||||||
|
num_constraints: 1
|
||||||
|
at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f
|
||||||
|
bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c
|
||||||
|
ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05
|
||||||
|
output:
|
||||||
|
- input_file: inputs/dummy.in
|
||||||
|
output:
|
||||||
|
registers:
|
||||||
|
r0:
|
||||||
|
type: bool
|
||||||
|
value: "true"
|
||||||
|
initial_ast: 66a1e88a4c0444227b95ed83e44e3cb1445a2d1263f6db50bc356ddeb29bb7e3
|
||||||
|
canonicalized_ast: 5a53d3d742bb46a0c04dabd15026f86aa5a936c113c64a36dbe05f77e167fe3e
|
||||||
|
type_inferenced_ast: 7368c0974ae1d2e4684e633fe4349a50fb1dbec96c4c20a3c526811f6b410f9e
|
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
namespace: Compile
|
||||||
|
expectation: Pass
|
||||||
|
outputs:
|
||||||
|
- circuit:
|
||||||
|
num_public_variables: 0
|
||||||
|
num_private_variables: 1
|
||||||
|
num_constraints: 1
|
||||||
|
at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f
|
||||||
|
bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c
|
||||||
|
ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05
|
||||||
|
output:
|
||||||
|
- input_file: inputs/dummy.in
|
||||||
|
output:
|
||||||
|
registers:
|
||||||
|
r0:
|
||||||
|
type: bool
|
||||||
|
value: "true"
|
||||||
|
initial_ast: eb9888a7cfa5059cd6a9314555516ec8122f40ffa6229877c276a8dca0bcc9f4
|
||||||
|
canonicalized_ast: a300cedc4d5404aa6b164e899f62f0173122305772e38063b5485bf14a2b60c3
|
||||||
|
type_inferenced_ast: 881bb9f0f8c2ef9b0dbc6af24a03a683fa00f45ac186a4dbd786c019052c6957
|
Loading…
Reference in New Issue
Block a user