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
Originally posted by clauBv23 July 10, 2024
When testing complex code a common scenario scenario involves verifying specific behaviors under different setups. For example in Sablier V2 Core, the test tree looks like this:
...
└── given all streams are warm
├── when the caller is unauthorized for all streams
│ ├── when the caller is a malicious third party
│ │ └── it should revert
│ └── when the caller is the recipient
│ └── it should revert
├── when the caller is unauthorized for some streams
│ ├── when the caller is a malicious third party
│ │ └── it should revert
│ └── when the caller is the recipient
│ └── it should revert
...
This tree structure checks that when the caller is a malicious third party and when the caller is the recipient should revert in both cases: when the caller is unauthorized for all streams and when the caller is unauthorized for some streams.
Using bulloak, this specification fails because in Solidity two functions or modifiers cannot have the same signature.
However, in the Sablier V2 Core repo this issue is managed by also appending the scenario description to the function name instead of just creating a modifier, as shown below:
function test_RevertWhen_CallerUnauthorizedAllStreams_MaliciousThirdParty()
external
whenNotDelegateCalled
whenArrayCountNotZero
givenNoNull
givenAllStreamsWarm
whenCallerUnauthorized
Is there a way to handle this in bulloak? or any workaround for this issue?
Perhaps a special word, character, or ASCII sequence in the tree, could be used to append the description to the function name?
The text was updated successfully, but these errors were encountered:
Discussed in #77
Originally posted by clauBv23 July 10, 2024
When testing complex code a common scenario scenario involves verifying specific behaviors under different setups. For example in Sablier V2 Core, the test tree looks like this:
This tree structure checks that
when the caller is a malicious third party
andwhen the caller is the recipient
should revert in both cases:when the caller is unauthorized for all streams
andwhen the caller is unauthorized for some streams
.Using
bulloak
, this specification fails because in Solidity two functions or modifiers cannot have the same signature.However, in the Sablier V2 Core repo this issue is managed by also appending the scenario description to the function name instead of just creating a modifier, as shown below:
Is there a way to handle this in bulloak? or any workaround for this issue?
Perhaps a special word, character, or ASCII sequence in the tree, could be used to append the description to the function name?
The text was updated successfully, but these errors were encountered: