9e8b451933
* This is in progress code. The plan is to support all literals before beginning to cleanup and dedup the mutation generation. Have to understand the AST and the possible mutations more in depth before making structural decisions here.
21 lines
496 B
Ruby
21 lines
496 B
Ruby
module Mutant
|
|
class Mutator
|
|
# Represent mutations on fixnum literal
|
|
class FixnumLiteral < Mutator
|
|
private
|
|
# Append mutants
|
|
#
|
|
# @param [#<<] generator
|
|
#
|
|
# @return [undefined]
|
|
#
|
|
def mutants(generator)
|
|
generator << new(Rubinius::AST::NilLiteral)
|
|
generator << new_self(0)
|
|
generator << new_self(1)
|
|
generator << new_self(-node.value)
|
|
generator << new_self(Mutant.random_fixnum)
|
|
end
|
|
end
|
|
end
|
|
end
|