2012-12-06 15:30:28 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
class Literal < self
|
|
|
|
# Abstract mutator for boolean literals
|
|
|
|
class Boolean < self
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutants
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
|
|
|
emit_nil
|
2013-06-04 14:22:42 -04:00
|
|
|
emit(s(self.class::INVERSE_TYPE))
|
2012-12-06 15:30:28 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
# Mutator for true literals
|
|
|
|
class TrueLiteral < self
|
2013-06-04 04:25:13 -04:00
|
|
|
INVERSE_TYPE = :false
|
2012-12-06 15:30:28 -05:00
|
|
|
|
2013-06-04 04:25:13 -04:00
|
|
|
handle(:true)
|
2012-12-06 15:30:28 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Mutator for false literals
|
|
|
|
class FalseLiteral < self
|
2013-06-04 04:25:13 -04:00
|
|
|
INVERSE_TYPE = :true
|
2012-12-06 15:30:28 -05:00
|
|
|
|
2013-06-04 04:25:13 -04:00
|
|
|
handle(:false)
|
2012-12-06 15:30:28 -05:00
|
|
|
end
|
2013-06-04 04:25:13 -04:00
|
|
|
|
|
|
|
end # Boolean
|
|
|
|
|
|
|
|
end # Literal
|
|
|
|
end # Node
|
|
|
|
end # Mutatork
|
|
|
|
end # Mutant
|