Coverage doesn't cover internal libs when passing implicit storage vars via the using
syntax
#4854
Closed
2 tasks done
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 (8f246e0 2023-04-28T00:14:27.758082000Z)
What command(s) is the bug in?
forge coverage --report lcov && genhtml -o forge-coverage lcov.info
Operating System
macOS (Apple Silicon)
Describe the bug
When importing an internal lib and utilizing it with the
using
syntax, coverage does not detect any hits on the functions in the library.Example is shown below (some code omitted for brevity):
Yields the following coverage report:
However, if I change the syntax of how the library function is called, where the storage variable isn't implicitly passed as the first argument, the coverage is correct.
Then coverage report is accurate:
Another important piece of information to add is that calling the Library function explicitly just once, ie the remainder of the
_stakes.addStake(...)
and any additional library calls to any/all functions using the implicit syntax are now covered.The text was updated successfully, but these errors were encountered: