You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently modifiers are considered individually and not as part of where they are called
this cause coverage to wrongly assume the modifier code has been called on all branches simply because if it was executed in another context
solidity-coverage should copy-paste the modifier code and generate branching check on that resulting code.
For now, the only workaround is to not use modifier and instead copy the modifier code in place.
will generate 100% coverage of branches even if only the following test are executed
transferOwnership from owner
setFee from owner
setFee from non-owner
the missing test for "transferOwnership from non-owner" will not be seen by the coverage.
On the contrary the following code will correctly trigger solidity-coverage to see less than 100% coverage as the require(... branching will be detected
Cool, I tried to find existing issue, but could not find (I think I was search for "modifiers" with a "s" :)
This is a duplicate of : #286
I ll close and I ll happily try the beta when I find some time. I ll report back
Currently
modifiers
are considered individually and not as part of where they are calledthis cause coverage to wrongly assume the
modifier
code has been called on all branches simply because if it was executed in another contextsolidity-coverage should copy-paste the
modifier
code and generate branching check on that resulting code.For now, the only workaround is to not use
modifier
and instead copy the modifier code in place.for example:
will generate 100% coverage of branches even if only the following test are executed
the missing test for "transferOwnership from non-owner" will not be seen by the coverage.
On the contrary the following code will correctly trigger solidity-coverage to see less than 100% coverage as the
require(...
branching will be detectedThe text was updated successfully, but these errors were encountered: