Skip to content

Conversation

@ruvaag
Copy link
Contributor

@ruvaag ruvaag commented Aug 31, 2023

Motivation

Resolve #5084 and prevent invariant tests with input args from panicking and crashing the program.

Solution

Ensure the invariant function does not have any input args before asserting the invariant. This allows any invalid tests to fail gracefully with a clear error message without affecting any other tests being run.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice, ty

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

very nice

@Evalir Evalir merged commit 577dae3 into foundry-rs:master Aug 31, 2023
@ruvaag ruvaag deleted the fix-invariant-test-inputs branch August 31, 2023 18:15
mikelodder7 pushed a commit to LIT-Protocol/foundry that referenced this pull request Sep 12, 2023
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.

bug(forge): running an invariant test with inputs makes forge crash

3 participants