mutant

https://github.com/mbj/mutant

Ruby

Automated code reviews via mutation testing - semantic code coverage.

Mutant::Mutator::Node::Binary#emit_left_negation

Emit left negation

We do not emit right negation as the `and` and `or` nodes
in ruby are also used for control flow.

Irrespective of their syntax, aka `||` parses internally to `or`.

`do_a or do_b`. Negating left makes sense, negating right
only when the result is actually used.

It *would* be possible to emit the right negation in case the use of the result is proved.
Like parent is an assignment to an {l,i}var. Dunno if we ever get the time to do that.

Source | Google | Stack overflow

Edit

git clone [email protected]:mbj/mutant.git

cd mutant

open lib/mutant/mutator/node/binary.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Mutant--Mutator--Node--Binary-emit_left_negation-for-pr


# Commit to git

git add lib/mutant/mutator/node/binary.rbgit commit -m "better docs for Mutant::Mutator::Node::Binary#emit_left_negation"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Mutant--Mutator--Node--Binary-emit_left_negation-for-pr

hub pull-request


# Celebrate!