Skip to content

fix(cheatcodes): count 0 swallows non-matching reverts #10867

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

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

yash-atreya
Copy link
Member

Motivation

Closes #10858

Solution

  • this ensures that when expectRevert(reason, 0) is used, the test fails if ANY revert
    occurs, with different error messages depending on whether the revert matches the expected criteria or not.
  • It is now consistent with the behaviour of expectRevert when count > 0.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@yash-atreya yash-atreya added C-forge Command: forge A-cheatcodes Area: cheatcodes T-likely-breaking Type: requires changes that can be breaking labels Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes C-forge Command: forge T-likely-breaking Type: requires changes that can be breaking
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

expectRevert with count = 0 swallows non-matching reverts
3 participants