2018-09-12 10:21:24 -04:00
|
|
|
# frozen_string_literal: true
|
2018-09-12 09:15:43 -04:00
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-05 12:37:31 -04:00
|
|
|
source 'if condition; true; else false; end'
|
|
|
|
|
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
|
|
|
|
# mutation of condition
|
2014-06-05 12:37:31 -04: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 08:57:14 -04:00
|
|
|
|
|
|
|
# Deleted else branch
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'if condition; true end'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
2014-12-21 15:47:27 -05:00
|
|
|
# Promote if branch
|
|
|
|
mutation 'true'
|
|
|
|
|
|
|
|
# Promote else branch
|
|
|
|
mutation 'false'
|
|
|
|
|
2014-08-12 19:34:20 -04:00
|
|
|
# Deleted if branch resulting in unless rendering
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'unless condition; false; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
|
|
|
# Deleted if branch with promoting else branch to if branch
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'if condition; false end'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
|
|
|
# mutation of if body
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'if condition; false; else false; end'
|
|
|
|
mutation 'if condition; nil; else false; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
|
|
|
# mutation of else body
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'if condition; true; else true; end'
|
|
|
|
mutation 'if condition; true; else nil; end'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'if condition; true; end'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04: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 15:47:27 -05:00
|
|
|
mutation 'true'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :if do
|
2014-06-05 12:37:31 -04: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 15:47:27 -05:00
|
|
|
mutation 'true'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
2016-03-06 16:19:32 -05:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :if do
|
|
|
|
source 'true if /foo/'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'false if /foo/'
|
|
|
|
mutation 'true if //'
|
|
|
|
mutation 'nil if /foo/'
|
|
|
|
mutation 'true if true'
|
|
|
|
mutation 'true if false'
|
|
|
|
mutation 'true if nil'
|
|
|
|
mutation 'true if /nomatch\A/'
|
|
|
|
mutation 'true'
|
|
|
|
end
|