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

Reverting and stopping execution using assertEq #7793

Open
sunbreak1211 opened this issue Apr 25, 2024 · 3 comments
Open

Reverting and stopping execution using assertEq #7793

sunbreak1211 opened this issue Apr 25, 2024 · 3 comments

Comments

@sunbreak1211
Copy link

Hey, not sure if I should upload this issue here or in foundry repo, but with the implementation of this commit: foundry-rs/forge-std@1432518 the behavior of assertEq changed (and I assume the others as well). It is now reverting and stopping execution instead of throwing a simple log and test failure.
I would believe this behavior change is not intended and we'd want to still stick with the original one (referred from example here:

/// DSTest will not revert inside its `assertEq`-like functions which allows
).

forge --version
forge 0.2.0 (e01038f 2024-04-25T00:29:53.251953000Z)
@mds1 mds1 transferred this issue from foundry-rs/forge-std Apr 26, 2024
@mds1
Copy link
Collaborator

mds1 commented Apr 26, 2024

This was intended behavior. Do you have a use case for continuing execution after failure? If so, perhaps it's feasible to add a flag to toggle the behavior used

@sunbreak1211
Copy link
Author

This was intended behavior. Do you have a use case for continuing execution after failure? If so, perhaps it's feasible to add a flag to toggle the behavior used

Nothing too specific but in general when running the tests for first time is nice to catch all the possible errors at once for correcting them (whatever they are contract or test ones) than having to fix it, run again, fix, run again...

@mds1
Copy link
Collaborator

mds1 commented May 2, 2024

Thank you for the feedback. I have also thought this a few times, e.g. when making a large change and expecting a lot of assertions to fail. cc @klkvr for thoughts

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

No branches or pull requests

2 participants