Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Is there any way that your specific tests could fail (i.e., catch a bug) that your more general test would pass? If "no", then you don't need the more specific tests. Commented Jul 2, 2013 at 19:56
  • The first two will never catch a situation the equality check won't, so I'd say this is over-complicating things. Commented Jul 2, 2013 at 19:57
  • 4
    Ehm, on items 1 and 2, only if you're working in a dynamically-typed language. In a statically-typed language, it won't compile if those two things aren't true. Commented Jul 2, 2013 at 19:57
  • 1
    @RobertHarvey Sorry, yes this situation did occur in a dynamically typed language. Commented Jul 2, 2013 at 20:05