▲ | Joker_vD 4 days ago | |||||||||||||||||||||||||
Pfft, you know how tests for functions like this:
are usually written? You take the switch's body, shove it into the test function, and then replace "case/return" with regexp to "assert.Equal" or something:
Look ma, we got that sweet 100% code coverage! | ||||||||||||||||||||||||||
▲ | gus_massa 4 days ago | parent | next [-] | |||||||||||||||||||||||||
The solution is to add integration testing,
the reverse composition is harder to test. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | BobbyTables2 4 days ago | parent | prev [-] | |||||||||||||||||||||||||
I feel attacked! (:> | ||||||||||||||||||||||||||
|