Do not emit rescue matchers with higher selectabillity

Closes #183
This commit is contained in:
Markus Schirp 2014-06-06 19:44:08 +00:00
parent 7638f5f29a
commit 1f38aeb042
2 changed files with 2 additions and 4 deletions

View file

@ -32,8 +32,8 @@ module Mutant
#
def mutate_captures
return unless captures
Util::Array.each(captures.children, self) do |matchers|
next if matchers.empty? || matchers.any? { |node| node.type == :nil }
Util::Array::Element.each(captures.children, self) do |matchers|
next if matchers.any? { |node| node.type.equal?(:nil) }
emit_captures(s(:array, *matchers))
end
end

View file

@ -9,8 +9,6 @@ Mutant::Meta::Example.add do
mutation 'begin; rescue ExceptionA, self => error; true; end'
mutation 'begin; rescue ExceptionA, ExceptionB => error; false; end'
mutation 'begin; rescue ExceptionA, ExceptionB => error; nil; end'
mutation 'begin; rescue ExceptionA => error; true; end'
mutation 'begin; rescue ExceptionB => error; true; end'
end
Mutant::Meta::Example.add do