DEV Community

Discussion on: How Simple is too Simple to Test?

Collapse
 
bgadrian profile image
Adrian B.G.

Another error is when you send an array with count(array) <= 1, because the count(arr) is NOT the first check, as it should be. Depending on the language also NULL can do the same error. (null[0] or null[1] would not work).

Collapse
 
bosepchuk profile image
Blaine Osepchuk

Good catch. That actually can't happen because if the way the data is generated but I agree the size check should be before the equality check. I've updated the production code to match.

Thanks for your comment.