Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mcobrien
on May 29, 2012
|
parent
|
context
|
favorite
| on:
Why I Hate Test Driven Development
You're right to want to avoid duplicating your code inside your test. In this case, I'd work out some simple permutations and test against those values, sorting the results so order doesn't matter.
assert(sorted(permute((1, 2))) == [(1, 2), (2, 1)])
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: