parent
89c8fc30e5
commit
7f47ac425e
3 changed files with 11 additions and 0 deletions
|
@ -47,6 +47,7 @@ module Mutant
|
|||
def mutate_if_branch
|
||||
emit_type(condition, else_branch, nil) if else_branch
|
||||
return unless if_branch
|
||||
emit(if_branch)
|
||||
emit_if_branch_mutations
|
||||
emit_type(condition, if_branch, nil)
|
||||
end
|
||||
|
@ -59,6 +60,7 @@ module Mutant
|
|||
#
|
||||
def mutate_else_branch
|
||||
return unless else_branch
|
||||
emit(else_branch)
|
||||
emit_else_branch_mutations
|
||||
emit_type(condition, nil, else_branch)
|
||||
end
|
||||
|
|
|
@ -14,6 +14,12 @@ Mutant::Meta::Example.add do
|
|||
# Deleted else branch
|
||||
mutation 'if condition; true end'
|
||||
|
||||
# Promote if branch
|
||||
mutation 'true'
|
||||
|
||||
# Promote else branch
|
||||
mutation 'false'
|
||||
|
||||
# Deleted if branch resulting in unless rendering
|
||||
mutation 'unless condition; false; end'
|
||||
|
||||
|
@ -39,6 +45,7 @@ Mutant::Meta::Example.add do
|
|||
mutation 'if true; true; end'
|
||||
mutation 'if false; true; end'
|
||||
mutation 'if nil; true; end'
|
||||
mutation 'true'
|
||||
end
|
||||
|
||||
Mutant::Meta::Example.add do
|
||||
|
@ -52,4 +59,5 @@ Mutant::Meta::Example.add do
|
|||
mutation 'unless condition; false; end'
|
||||
mutation 'unless condition; nil; end'
|
||||
mutation 'if condition; true; end'
|
||||
mutation 'true'
|
||||
end
|
||||
|
|
|
@ -11,4 +11,5 @@ Mutant::Meta::Example.add do
|
|||
mutation 'true if false'
|
||||
mutation 'true if nil'
|
||||
mutation 'true if /a\A/'
|
||||
mutation 'true'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue