alexfertel / bulloak

A Solidity test generator based on the Branching Tree Technique.
Apache License 2.0
225 stars 13 forks source link

Stop scaffolding trees with duplicated conditions #35

Closed alexfertel closed 7 months ago

alexfertel commented 9 months ago

The following tree:

applyAccruedFundingTest
├── it should call _updateFundingIndex
└── when funding index changes
    ├── it should emit AccruedFundingApplied event
    ├── it should update the lastFundingIndexApplied
    ├── when position is long
    │   ├── when funding index is greater than lastFundingIndexApplied
    │   │   └── it should increase the entry price
    │   └── when funding index is less than lastFundingIndexApplied
    │       └── it should decrease the entry price
    └── when position is short
        ├── when funding index is greater than lastFundingIndexApplied
        │   └── it should decrease the entry price
        └── when funding index is less than lastFundingIndexApplied
            └── it should increase the entry price

should error when scaffolding since we can't generate duplicated test names -- that's not valid solidity syntax. Right now, we scaffold and silently dedup the conditions.

alexfertel commented 7 months ago

Solved by https://github.com/alexfertel/bulloak/commit/3bcad25241dffcd00aa654b2b5b8b18c947e3e15