3 ms·
No. It's the same. If you have a function with a large if statement in it, you'd want to test all conditions within that if statement to make sure it was workin
by innocentoldguy 5y ago
No. It's the same. If you have a function with a large if statement in it, you'd want to test all conditions within that if statement to make sure it was working, right?
You'd do the exact same thing if you were testing a series of pattern-matched functions. The tests would be unchanged either way.
- jkhdigital 5y agoI think it makes it easier to tick off the list of cases that need to be tested: one for each head.
- ofrzeta 5y agoYou'd have the number of tests broadly but they are simpler because they don't need to handle the cases hidden in the functions themselves. Maybe in the end it's the same or a matter of taste but it recently occurred to me that unit testing becomes "cleaner" that way.