mutant icon indicating copy to clipboard operation
mutant copied to clipboard

Add mutation from `expression1 or expression2` to `expression2 unless expression1`

Open dkubb opened this issue 9 years ago • 2 comments

This specific mutation will expose cases where or is used but the return value of the second expression is not used when the first expression is invalid. It is usually only necessary to use or when you are relying on it's lower precedence to chain together multiple statements, otherwise an unless is usually simpler and cleaner.

A similar mutation could apply to and, where expression1 and expression could be mutated to expression2 if expression1.

dkubb avatar Jul 21 '14 20:07 dkubb

Looks like I typo'd the issue number in the commits related to this. Just for the sake of keeping github issues and commits linked:

  • commit: https://github.com/backus/mutant/commit/2f53ef0d01b0e86ecc0c634344711ad24265aa38
  • PR: https://github.com/mbj/mutant/pull/430
  • Revert PR: https://github.com/mbj/mutant/pull/437

backus avatar Sep 01 '15 16:09 backus

@backus thx for that.

mbj avatar Sep 01 '15 16:09 mbj