parent
b2a7c97606
commit
ad162c2a42
4 changed files with 31 additions and 1 deletions
|
@ -69,6 +69,7 @@ require 'mutant/mutator/node/return'
|
|||
require 'mutant/mutator/node/block'
|
||||
require 'mutant/mutator/node/if'
|
||||
require 'mutant/mutator/node/case'
|
||||
require 'mutant/mutator/node/splat'
|
||||
require 'mutant/config'
|
||||
require 'mutant/loader'
|
||||
require 'mutant/context'
|
||||
|
|
|
@ -12,7 +12,7 @@ module Mutant
|
|||
:zsuper, :not, :or, :and, :defined,
|
||||
:next, :break, :match, :gvar, :cvar, :ensure,
|
||||
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
|
||||
:lvar, :splat, :const, :blockarg, :block_pass, :op_asgn, :and_asgn,
|
||||
:lvar, :const, :blockarg, :block_pass, :op_asgn, :and_asgn,
|
||||
:regopt, :ivar, :restarg, :casgn, :resbody, :retry, :arg_expr,
|
||||
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :cbase, :empty,
|
||||
:alias, :for, :xstr, :back_ref, :nth_ref, :class,
|
||||
|
|
27
lib/mutant/mutator/node/splat.rb
Normal file
27
lib/mutant/mutator/node/splat.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module Mutant
|
||||
class Mutator
|
||||
class Node
|
||||
class Splat < self
|
||||
|
||||
handle :splat
|
||||
|
||||
children :expression
|
||||
|
||||
private
|
||||
|
||||
# Perform dispatch
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def dispatch
|
||||
emit_nil
|
||||
emit_expression_mutations
|
||||
emit(expression)
|
||||
end
|
||||
|
||||
end # Splat
|
||||
end # Node
|
||||
end # Mutator
|
||||
end # Mutant
|
|
@ -31,6 +31,8 @@ describe Mutant::Mutator, 'send' do
|
|||
let(:mutations) do
|
||||
mutations = []
|
||||
mutations << 'foo'
|
||||
mutations << 'foo(nil)'
|
||||
mutations << 'foo(bar)'
|
||||
end
|
||||
|
||||
it_should_behave_like 'a mutator'
|
||||
|
|
Loading…
Reference in a new issue