Skip to content

Commit

Permalink
Add a regression test for 6834
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Dec 17, 2024
1 parent 73ccd45 commit 55153df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test_programs/execution_success/regression_6834/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "regression_6834"
version = "0.1.0"
type = "bin"
authors = [""]

[dependencies]
2 changes: 2 additions & 0 deletions test_programs/execution_success/regression_6834/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
year = 2000
min_age = 20
13 changes: 13 additions & 0 deletions test_programs/execution_success/regression_6834/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn main(year: u32, min_age: u8) {
if min_age == 0 {
if year > 2028 {
assert((((year - 1) - 2028) / 4 + 1) as i32 >= 0);
}
} else {
if year > 2028 {
// Uncomment the next line and the assertion on line 10 will pass
// assert(year > 2028);
assert((((year - 1) - 2028) / 4 + 1) as i32 >= 0);
}
}
}

0 comments on commit 55153df

Please sign in to comment.