Bram-Hub / LEGUP

Logic Engine for Grid-Using Puzzles - a better way to learn formal logic
GNU General Public License v3.0
33 stars 82 forks source link

[ENHANCEMENT] Case rule tests should test justifying changes with case rules #777

Open charlestian23 opened 6 months ago

charlestian23 commented 6 months ago

Describe the current behavior of what you're trying to improve. If your enhancement request related to a problem, please also describe the problem.

In light of #755, I realized that case rules can run into issues when they allow for 1 branch to be created. There are weird edge cases where the case rule transition can be green when it is used to justify changes on the board. This seems to be due to the fact that all case rules use childTransitions.size() as part of some basic error checking, which always defaults to 1 when changes are made on the board.

Describe the improvement you'd like

Case rules that allow for 1 branch to be created (for example, Satisfy Number in Light Up) should have a test ensuring that modifications to the board cannot be used to justify changes made on the board unless the the user manually creates the 1 remaining case.

Describe alternatives you've considered

The alternative is to just not have a test for this, which I don't think would be a good thing.

Additional Context

No response