This is an excellent approach to pick apart complicated logic and check that all bases are covered; essentially a Truth table in code.
As you noted, the number of cases grows rapidly with the inputs, so logic minimization techniques (tables with Don't-care terms and Karnaugh maps) can be really helpful to simplify that, as can separating the outputs.
I've often written out a truth table in comments above the (minimized) logic/code that implements it.
In reply to Re: Case Exhaustion Tree
by Anonymous Monk
in thread Case Exhaustion Tree
by Xiong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |