free_mutant/lib/mutant/mutator/node/literal/boolean.rb

33 lines
601 B
Ruby
Raw Normal View History

module Mutant
class Mutator
class Node
class Literal < self
# Abstract mutator for boolean literals
class Boolean < self
2013-06-10 03:19:31 -04:00
handle :true, :false
private
2013-06-10 03:19:31 -04:00
MAP = {
:true => :false,
:false => :true
}.freeze
# Emit mutants
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_nil
2013-06-10 03:19:31 -04:00
emit(s(MAP.fetch(node.type)))
end
end # Boolean
end # Literal
end # Node
end # Mutatork
end # Mutant