free_mutant/meta/or_asgn.rb
Markus Schirp 13cd04d9be Introduce AST::Meta to externalize semantic analysis
* Add Mutant::AST namespace to hold all AST related data / helpers.
* Mutant::AST will be externalized into an ast-meta gem that can be
  shared with unparser for deduplication.
* Over the time the mutators itself will not need to deal with semantic
  analysis of the AST anymore by themselves.
* Move AST analysis for send nodes to AST::Meta
* Fix #209
2014-06-29 21:26:58 +00:00

35 lines
664 B
Ruby

# encoding: utf-8
Mutant::Meta::Example.add do
source 'a ||= 1'
singleton_mutations
mutation 'a__mutant__ ||= 1'
mutation 'a ||= nil'
mutation 'a ||= self'
mutation 'a ||= 0'
mutation 'a ||= -1'
mutation 'a ||= 2'
end
Mutant::Meta::Example.add do
source '@a ||= 1'
singleton_mutations
mutation '@a ||= nil'
mutation '@a ||= self'
mutation '@a ||= 0'
mutation '@a ||= -1'
mutation '@a ||= 2'
end
Mutant::Meta::Example.add do
source 'foo[:bar] ||= 1'
singleton_mutations
mutation 'foo[:bar] ||= nil'
mutation 'foo[:bar] ||= self'
mutation 'foo[:bar] ||= 0'
mutation 'foo[:bar] ||= -1'
mutation 'foo[:bar] ||= 2'
end