Add mutation from csend to send
This commit is contained in:
parent
47dcad29ea
commit
8f6d9384c1
6 changed files with 38 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
# v0.8.11 2016-01-xx
|
||||
|
||||
* Add support for mutating csend (duck tape operator) into regular sends
|
||||
|
||||
# v0.8.10 2016-01-24
|
||||
|
||||
* Add support for parser 2.3 (via unparser 0.2.5)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
threshold: 18
|
||||
total_score: 1167
|
||||
total_score: 1170
|
||||
|
|
|
@ -113,6 +113,7 @@ require 'mutant/mutator/node/zsuper'
|
|||
require 'mutant/mutator/node/restarg'
|
||||
require 'mutant/mutator/node/send'
|
||||
require 'mutant/mutator/node/send/binary'
|
||||
require 'mutant/mutator/node/send/conditional'
|
||||
require 'mutant/mutator/node/send/attribute_assignment'
|
||||
require 'mutant/mutator/node/send/index'
|
||||
require 'mutant/mutator/node/when'
|
||||
|
|
|
@ -8,7 +8,7 @@ module Mutant
|
|||
# These nodes still need a dedicated mutator,
|
||||
# your contribution is that close!
|
||||
handle(
|
||||
:csend, :ensure, :redo, :regopt, :retry, :arg_expr,
|
||||
:ensure, :redo, :regopt, :retry, :arg_expr,
|
||||
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
|
||||
:alias, :for, :xstr, :back_ref, :class,
|
||||
:sclass, :match_with_lvasgn, :while_post,
|
||||
|
|
23
lib/mutant/mutator/node/send/conditional.rb
Normal file
23
lib/mutant/mutator/node/send/conditional.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
module Mutant
|
||||
class Mutator
|
||||
class Node
|
||||
class Send
|
||||
class Conditional < self
|
||||
|
||||
handle(:csend)
|
||||
|
||||
private
|
||||
|
||||
# Perform dispatch
|
||||
#
|
||||
# @return [undefined]
|
||||
def dispatch
|
||||
super()
|
||||
emit(s(:send, *children))
|
||||
end
|
||||
|
||||
end # Conditional
|
||||
end # Send
|
||||
end # Node
|
||||
end # Mutator
|
||||
end # Mutant
|
8
meta/csend.rb
Normal file
8
meta/csend.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
Mutant::Meta::Example.add do
|
||||
source 'a&.b'
|
||||
|
||||
singleton_mutations
|
||||
mutation 'a.b'
|
||||
mutation 'self&.b'
|
||||
mutation 'a'
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue