2016-03-19 15:13:05 +00:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-05 16:37:31 +00:00
|
|
|
source 'if condition; true; else false; end'
|
|
|
|
|
|
|
|
singleton_mutations
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# mutation of condition
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'if !condition; true; else false; end'
|
|
|
|
mutation 'if nil; true; else false; end'
|
|
|
|
mutation 'if true; true; else false; end'
|
|
|
|
mutation 'if false; true; else false; end'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# Deleted else branch
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'if condition; true end'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
2014-12-21 20:47:27 +00:00
|
|
|
# Promote if branch
|
|
|
|
mutation 'true'
|
|
|
|
|
|
|
|
# Promote else branch
|
|
|
|
mutation 'false'
|
|
|
|
|
2014-08-12 16:34:20 -07:00
|
|
|
# Deleted if branch resulting in unless rendering
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'unless condition; false; end'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# Deleted if branch with promoting else branch to if branch
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'if condition; false end'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# mutation of if body
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'if condition; false; else false; end'
|
|
|
|
mutation 'if condition; nil; else false; end'
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
# mutation of else body
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation 'if condition; true; else true; end'
|
|
|
|
mutation 'if condition; true; else nil; end'
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
|
2016-03-19 15:13:05 +00:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-02 12:57:14 +00:00
|
|
|
source 'if condition; true; end'
|
|
|
|
|
2014-06-05 16:37:31 +00:00
|
|
|
singleton_mutations
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation 'if !condition; true; end'
|
|
|
|
mutation 'if condition; false; end'
|
|
|
|
mutation 'if condition; nil; end'
|
|
|
|
mutation 'if true; true; end'
|
|
|
|
mutation 'if false; true; end'
|
|
|
|
mutation 'if nil; true; end'
|
2014-12-21 20:47:27 +00:00
|
|
|
mutation 'true'
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
|
2016-03-19 15:13:05 +00:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-05 16:37:31 +00:00
|
|
|
source 'unless condition; true; end'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'unless !condition; true; end'
|
|
|
|
mutation 'unless nil; true; end'
|
|
|
|
mutation 'unless true; true; end'
|
|
|
|
mutation 'unless false; true; end'
|
|
|
|
mutation 'unless condition; false; end'
|
|
|
|
mutation 'unless condition; nil; end'
|
|
|
|
mutation 'if condition; true; end'
|
2014-12-21 20:47:27 +00:00
|
|
|
mutation 'true'
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|