6 ms·
I'm not sure what your point is here - your implementation will fail the parent's test?
by nmfisher 6y ago
I'm not sure what your point is here - your implementation will fail the parent's test?
- deadso 6y agoTheir point is that the test case provided would lead the developer to believe that the implementation is a correct identity function, when in fact it isn't. Just clarifying, I do not take this as a good reason to not write tests.
- nmfisher 6y agoAh, right. I didn't realize some people believe tests should "prove" the correctness of a function (or that if they can't, they're worthless). Testing has its flaws, but that's not one of them. There's often very good reason to ask the question "does this function operate the way I expect it to when I provide this input?"