I have recently been in situations where I have down-voted answers based on a test case where it fails (these cases may be corner cases though). I usually put a comment to why I have down-voted something.
If I see modifications in the answer, I would retract the downvote and upvote if necessary. But sometimes I have received replies saying: "But why? My code works and I am fine with it."
Since I already have a test case where the code fails, I would consider the OP's working code as a corner case.
How can I deal with this situation?
Notes:
I would restrict the term test case to the input - which is perfectly valid in the premises of the question.
the code fails
not because it can't be generalized but because it is poorly written, or doesn't follow good practices - hence fails a test case - In general they set a bad example for future readers.I would like to consider that majority of the questions asked here are specific to a problem.
Please don't interpret this question as Should I down-vote if the answer doesn't is not general enough?
I would imagine you could downvote almost any answer on Stack Overflow on that basis.
Well not so ! :) My answers have been down-voted for the same reason and from my personal experience this is a constructive(and often friendly:)) process where an op understands that some obvious mistakes in code could have been avoided.. At the same time I understand that there is noperfect code