this post was submitted on 16 Sep 2024
132 points (95.2% liked)

Programmer Humor

37208 readers
993 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

you are viewing a single comment's thread
view the rest of the comments
[โ€“] deadbeef79000@lemmy.nz 15 points 10 months ago* (last edited 10 months ago) (1 children)

This is why it's important to have tests that assert a system's failure modes too.

shouldFitTriangleInTriangleHole()

shouldNotFitTriangleInAnyOtherHoles()

Bonus points for just parameterizing it.

[โ€“] elvith@feddit.org 4 points 10 months ago
 assert triangleObject.shouldFitInHole(triangleHole) == true

assert triangleObject.shouldFitInHole(squareHole) == false