From dcf2b6fa47990ad9aff172ea616c9ffd0e7833f8 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Mon, 27 Mar 2023 10:08:21 -0700 Subject: [PATCH] Add test --- .../iteration_bound_too_large_fail.leo | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/tests/compiler/statements/iteration_bound_too_large_fail.leo diff --git a/tests/tests/compiler/statements/iteration_bound_too_large_fail.leo b/tests/tests/compiler/statements/iteration_bound_too_large_fail.leo new file mode 100644 index 0000000000..2f1a65cdb7 --- /dev/null +++ b/tests/tests/compiler/statements/iteration_bound_too_large_fail.leo @@ -0,0 +1,17 @@ +/* +namespace: Compile +expectation: Fail +*/ + +program test.aleo { + function calculate_interest(principal: u64, rate: u64, periods: u64) -> u64 { + let amount: u64 = principal; + + for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 { + if i < periods { + amount += (amount * rate) / 10000u64; + } + } + return amount; + } +} \ No newline at end of file