-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Never failing Solidity unit testing #745
Comments
Hi @GNSPS. It seems like the underlying issue might be a quirk relating to However, if the only defined Jorge Izquierdo at Aragon has written a nice Medium post about libraries and says there:
So one fix would be to additionally define |
Looking at this more i wonder if linking the AssertBytes library and the test suite contracts in a deployment step is what really needs to be done here. The comment above has the glaring flaw that Assert is also a library, so . . . why does it work ok? |
@GNSPS This should be fixed in the latest release. Please re-open if continue to see this problem, or the patch doesn't work for any other reason. Thanks! |
Thank you so much @cgewecke!! 🙌 And sorry for the delay! Appreciated very much your prompt response! 😄 |
Issue
Solidity unit testing in Truffle doesn't work (no tests fail) unless you invoke any method of Truffle's
Assert
library.Found this while doing unit testing with an assertion library of my own which complies with Truffle's
TestEvent
firing.Steps to Reproduce
Run the tests from this repo:
https://github.com/GNSPS/solidity-bytes-utils
But remove this line:
https://github.com/GNSPS/solidity-bytes-utils/blob/master/test/TestBytesLib1.sol#L45
Which is the fix for the affliction I mentioned.
Expected Behavior
For the test to run independent of calling a method from
Assert.sol
Actual Results
All tests were passing irregardless of wether they were firing false
TestEvent
s or not.Environment
The text was updated successfully, but these errors were encountered: