-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ACIR optimizer should update assertion messages (#3010)
- Loading branch information
1 parent
db1e736
commit 758b6b6
Showing
4 changed files
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
tooling/nargo_cli/tests/noir_test_failure/should_fail_mismatch/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
|
||
#[test(should_fail_with = "Not equal")] | ||
fn test_main_1() { | ||
fn test_different_string() { | ||
assert_eq(0, 1, "Different string"); | ||
} | ||
|
||
// The assert message has a space | ||
#[test(should_fail_with = "Not equal")] | ||
fn test_main_1() { | ||
fn test_with_extra_space() { | ||
assert_eq(0, 1, "Not equal "); | ||
} | ||
|
||
// The assert message has a space | ||
#[test(should_fail_with = "Not equal")] | ||
fn test_runtime_mismatch() { | ||
assert_eq(dep::std::hash::pedersen([27])[0], 0, "Not equal "); | ||
} |
20 changes: 17 additions & 3 deletions
20
tooling/nargo_cli/tests/noir_test_success/should_fail_with_matches/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
|
||
#[test(should_fail_with = "Not equal")] | ||
fn test_main_1() { | ||
fn test_should_fail_with_match() { | ||
assert_eq(0, 1, "Not equal"); | ||
} | ||
} | ||
|
||
#[test(should_fail)] | ||
fn test_should_fail_without_match() { | ||
assert_eq(0, 1); | ||
} | ||
|
||
#[test(should_fail_with = "Not equal")] | ||
fn test_should_fail_with_runtime_match() { | ||
assert_eq(dep::std::hash::pedersen([27])[0], 0, "Not equal"); | ||
} | ||
|
||
#[test(should_fail)] | ||
fn test_should_fail_without_runtime_match() { | ||
assert_eq(dep::std::hash::pedersen([27])[0], 0); | ||
} |