alexfertel / bulloak

Generate tests based on the Branching Tree Technique.
https://bulloak.dev
Apache License 2.0
260 stars 14 forks source link

Bug: RevertWhen_Something doesn't apply when adding revert comments #69

Closed wei3erHase closed 3 months ago

wei3erHase commented 3 months ago

The it should revert keyword is ignored if there is a dependant leaf comment on the branch, which causes the translated test methods to be missing the RevertWhen.

Context:

FooTest
└── When stuff is called // Comments are supported.
    └── When a condition is met
        └── It should revert.
            └── Because we shouldn't allow it.

Expected behaviour:

    function test_RevertWhen_PassingAnEmptyGreetingString() external {
        // it should revert
        //     Because we shouldn't allow it.
    }

Actual behaviour:

    function test_WhenPassingAnEmptyGreetingString() external {
        // it should revert
        //      Because we shouldn't allow it.
    }
alexfertel commented 3 months ago

Hey! Thanks for the bug report. It seems we had a regression somewhere along the way, you're totally right.

I'll fix it and cut a release in a few minutes.

alexfertel commented 3 months ago

Okay, resolved in https://github.com/alexfertel/bulloak/commit/9f151c6702882532a866395af2e61f79275e5812. If you cargo install bulloak again, you should get v0.7.3, which includes the fix! @wei3erHase