Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Handle should_fail_with case #2541

Merged
merged 54 commits into from
Sep 8, 2023
Merged

feat: Handle should_fail_with case #2541

merged 54 commits into from
Sep 8, 2023

Conversation

kevaundray
Copy link
Contributor

@kevaundray kevaundray commented Sep 3, 2023

Description

resolves #2484 .

I think the code for testing could do with quite a bit of love and refactoring.

Problem*

Resolves

Summary*

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher
Copy link
Contributor

jfecher commented Sep 7, 2023

When I run this PR with the code:

#[test(should_fail_with = "f")]
fn foo() {
    assert(false, "fdsa")
}

It still passes, even though I'd expect it to fail.

Edit: Oh I see, we're just testing if the actual message contains the expected message. I didn't expect that but now that I know it makes sense.

@kevaundray
Copy link
Contributor Author

n though I'd expect it to fail

Just asked Lasse and he would expect that to fail, so I'll change it!

vezenovm
vezenovm previously approved these changes Sep 7, 2023
Copy link
Contributor

@vezenovm vezenovm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly some style suggestions, but non-blocking. It would nice to add nargo test capabilities to our testing suite as well, but that is for a separate PR.

crates/nargo/src/ops/test.rs Show resolved Hide resolved
crates/nargo/src/ops/test.rs Show resolved Hide resolved
crates/nargo_cli/src/cli/execute_cmd.rs Outdated Show resolved Hide resolved
crates/nargo/src/ops/test.rs Outdated Show resolved Hide resolved
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
vezenovm
vezenovm previously approved these changes Sep 7, 2023
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
@kevaundray kevaundray added this pull request to the merge queue Sep 7, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 7, 2023
@vezenovm vezenovm added this pull request to the merge queue Sep 8, 2023
Merged via the queue into master with commit 291d002 Sep 8, 2023
13 checks passed
@vezenovm vezenovm deleted the kw/should-fail-with branch September 8, 2023 03:48
superstar0402 added a commit to superstar0402/aztec-nr that referenced this pull request Aug 16, 2024
Fixes #1965 with should fail test cases. Should be redone with complete
failure messages when noir-lang/noir#2541 is
ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should panic with specific message
4 participants