-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
bug(forge): coverage does not work for enum assignments #4315
Labels
Comments
This was referenced Feb 9, 2023
Closed
11 tasks
Able to reproduce, now still yields:
|
zerosnacks
added
C-forge
Command: forge
Cmd-forge-coverage
Command: forge coverage
labels
Jun 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (249538f 2023-02-08T00:12:05.805004Z)
What command(s) is the bug in?
forge coverage
Operating System
macOS (Apple Silicon)
Describe the bug
Take the following contract (hidden by default for brevity reasons, click the toggle below to collapse it):
Click me to toggle the contract
And the following tests (again, hidden for brevity):
Click me to toggle the tests
Now, run
forge coverage
. You will get this report:Notice that the branch coverage is 75% even if we do have full coverage of all the possible branches of the
closeIfEqValue
function:By contrast, the coverage for the
incrementIfEqValue
function is 100%, which shows that this bug is specifically about enum assignments.closeIfEqValue
andincrementIfEqValue
are fully equivalent, except for the enum assignment.The text was updated successfully, but these errors were encountered: