Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless binary left negation #1252

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.10.33 unreleased

* [#1252](https://github.com/mbj/mutant/pull/1252)
Remove not universally useful binaryl left negation operator.

# v0.10.33 2021-08-25

* [#1249](https://github.com/mbj/mutant/pull/1249/files)
Expand Down
5 changes: 0 additions & 5 deletions lib/mutant/mutator/node/binary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def dispatch
emit_singletons
emit_promotions
emit_operator_mutations
emit_left_negation
emit_left_mutations
emit_right_mutations
end
Expand All @@ -35,10 +34,6 @@ def emit_promotions
emit(right)
end

def emit_left_negation
emit(s(node.type, n_not(left), right))
end

end # Binary
end # Node
end # Mutator
Expand Down
1 change: 0 additions & 1 deletion meta/and.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
mutation 'true or false'
mutation 'false and false'
mutation 'true and true'
mutation '!true and false'
end
14 changes: 13 additions & 1 deletion meta/or.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@
mutation 'false or false'
mutation 'true or true'
mutation 'true and false'
mutation '!true or false'
end

Mutant::Meta::Example.add :or do
source 'a = true or false'

singleton_mutations
mutation 'false'
mutation 'a = true'
mutation 'a = false or false'
mutation 'a = true or true'
mutation 'a = true and false'
mutation 'nil or false'
mutation 'a__mutant__ = true or false'
end