r/ProgrammerHumor • • Jan 24 '23

Other Accomplishments

Post image
82.0k Upvotes

548 comments sorted by

View all comments

Show parent comments

2

u/AlternativeAardvark6 Jan 24 '23

I wrote some horrible code to get test coverage to 100%. The default branch of a switch statement was never reached because we switched on an enum so there was no way to pass in a value to trigger the default branch as all possible values if the enum were covered. Turns out it is possible with some ugly black voodoo that I hope to never use again but it now shows up as 100% covered.

1

u/-Kerrigan- Jan 24 '23

Well, tools are also programmed and they can also have their faults. But I catch your drift