Skip to content

Commit

Permalink
chore: add regression test for issue 4449 (#4503)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Related to issue #4449 

## Summary\*
This PR adds a regression test which ensure PR #4492 is able to handle
large CFG.


## Additional Context



## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [X ] I have tested the changes locally.
- [ X] I have formatted the changes with
[Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
  • Loading branch information
guipublic authored Mar 7, 2024
1 parent 99c4d27 commit 2a555a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test_programs/execution_success/regression_4449/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "regression_4449"
type = "bin"
authors = [""]

[dependencies]
3 changes: 3 additions & 0 deletions test_programs/execution_success/regression_4449/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

x = 0xbd
result = [204, 59, 83, 197, 18, 1, 128, 43, 247, 28, 104, 225, 106, 13, 20, 187, 42, 26, 67, 150, 48, 75, 238, 168, 121, 247, 142, 160, 71, 222, 97, 188]
14 changes: 14 additions & 0 deletions test_programs/execution_success/regression_4449/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Regression test for issue #4449
use dep::std;

fn main(x: u8, result: [u8; 32]) {
let x = x % 31;
let mut digest = [0; 32];
for i in 0..70 {
let y = x + i;
let a = [y, x, 32, 0, y + 1, y - 1, y - 2, 5];
digest = std::sha256::digest(a);
}

assert(digest == result);
}

0 comments on commit 2a555a0

Please sign in to comment.