free_mutant/meta/lvar.rb
Markus Schirp 7bf70d9634 Add support for explicit type in meta examples
* This is needed to relate examples to node types for nodes that cannot
  stand alone. Example are :where nodes that do not have syntax outside
  a :case
2016-03-19 15:13:05 +00:00

14 lines
470 B
Ruby

Mutant::Meta::Example.add :lvar do
source 'a = nil; a'
mutation 'a = nil; nil'
mutation 'a = nil; self'
mutation 'a = nil'
# TODO: fix invalid AST
# These ASTs are not valid and should NOT be emitted
# Mutations of lvarasgn need to be special cased to avoid this.
mutation s(:begin, s(:lvasgn, :a__mutant__, s(:nil)), s(:lvar, :a))
mutation s(:begin, s(:nil), s(:lvar, :a))
mutation s(:begin, s(:self), s(:lvar, :a))
mutation s(:lvar, :a)
end