mutant 0.9.4 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +121 -0
- data/Changelog.md +26 -0
- data/Gemfile +0 -15
- data/Gemfile.lock +47 -58
- data/Gemfile.shared +7 -0
- data/LICENSE +1 -1
- data/README.md +72 -23
- data/config/reek.yml +1 -0
- data/config/rubocop.yml +10 -3
- data/docs/commercial-support.md +14 -0
- data/lib/mutant.rb +5 -1
- data/lib/mutant/ast.rb +0 -9
- data/lib/mutant/ast/find_metaclass_containing.rb +48 -0
- data/lib/mutant/ast/meta/send.rb +0 -6
- data/lib/mutant/bootstrap.rb +0 -36
- data/lib/mutant/cli.rb +6 -50
- data/lib/mutant/color.rb +0 -3
- data/lib/mutant/config.rb +0 -8
- data/lib/mutant/context.rb +0 -3
- data/lib/mutant/diff.rb +0 -17
- data/lib/mutant/env.rb +0 -6
- data/lib/mutant/expression/method.rb +6 -6
- data/lib/mutant/expression/methods.rb +6 -6
- data/lib/mutant/expression/parser.rb +0 -6
- data/lib/mutant/integration.rb +0 -18
- data/lib/mutant/isolation/fork.rb +0 -22
- data/lib/mutant/license.rb +12 -1
- data/lib/mutant/matcher.rb +0 -14
- data/lib/mutant/matcher/config.rb +0 -11
- data/lib/mutant/matcher/method.rb +0 -31
- data/lib/mutant/matcher/method/instance.rb +0 -8
- data/lib/mutant/matcher/method/metaclass.rb +86 -0
- data/lib/mutant/matcher/method/singleton.rb +0 -25
- data/lib/mutant/matcher/methods.rb +17 -28
- data/lib/mutant/matcher/namespace.rb +0 -10
- data/lib/mutant/matcher/scope.rb +2 -4
- data/lib/mutant/meta.rb +1 -3
- data/lib/mutant/meta/example/dsl.rb +0 -21
- data/lib/mutant/meta/example/verification.rb +1 -21
- data/lib/mutant/mutation.rb +0 -3
- data/lib/mutant/mutator.rb +1 -29
- data/lib/mutant/mutator/node.rb +1 -66
- data/lib/mutant/mutator/node/and_asgn.rb +0 -3
- data/lib/mutant/mutator/node/argument.rb +0 -15
- data/lib/mutant/mutator/node/arguments.rb +0 -20
- data/lib/mutant/mutator/node/begin.rb +0 -3
- data/lib/mutant/mutator/node/binary.rb +0 -23
- data/lib/mutant/mutator/node/block.rb +0 -15
- data/lib/mutant/mutator/node/break.rb +0 -3
- data/lib/mutant/mutator/node/case.rb +0 -9
- data/lib/mutant/mutator/node/class.rb +0 -3
- data/lib/mutant/mutator/node/conditional_loop.rb +0 -3
- data/lib/mutant/mutator/node/const.rb +0 -3
- data/lib/mutant/mutator/node/define.rb +0 -11
- data/lib/mutant/mutator/node/defined.rb +0 -3
- data/lib/mutant/mutator/node/dstr.rb +0 -3
- data/lib/mutant/mutator/node/dsym.rb +0 -3
- data/lib/mutant/mutator/node/generic.rb +0 -51
- data/lib/mutant/mutator/node/if.rb +0 -12
- data/lib/mutant/mutator/node/index.rb +0 -27
- data/lib/mutant/mutator/node/kwbegin.rb +0 -3
- data/lib/mutant/mutator/node/literal.rb +0 -3
- data/lib/mutant/mutator/node/literal/array.rb +0 -6
- data/lib/mutant/mutator/node/literal/boolean.rb +0 -4
- data/lib/mutant/mutator/node/literal/float.rb +0 -9
- data/lib/mutant/mutator/node/literal/hash.rb +0 -9
- data/lib/mutant/mutator/node/literal/integer.rb +0 -9
- data/lib/mutant/mutator/node/literal/nil.rb +0 -3
- data/lib/mutant/mutator/node/literal/range.rb +0 -6
- data/lib/mutant/mutator/node/literal/regex.rb +0 -6
- data/lib/mutant/mutator/node/literal/string.rb +0 -3
- data/lib/mutant/mutator/node/literal/symbol.rb +0 -3
- data/lib/mutant/mutator/node/masgn.rb +0 -3
- data/lib/mutant/mutator/node/match_current_line.rb +0 -3
- data/lib/mutant/mutator/node/mlhs.rb +0 -3
- data/lib/mutant/mutator/node/named_value/access.rb +2 -14
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +0 -9
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -6
- data/lib/mutant/mutator/node/next.rb +0 -3
- data/lib/mutant/mutator/node/noop.rb +0 -3
- data/lib/mutant/mutator/node/nthref.rb +0 -3
- data/lib/mutant/mutator/node/op_asgn.rb +0 -3
- data/lib/mutant/mutator/node/or_asgn.rb +0 -3
- data/lib/mutant/mutator/node/procarg_zero.rb +0 -3
- data/lib/mutant/mutator/node/regopt.rb +0 -6
- data/lib/mutant/mutator/node/resbody.rb +0 -6
- data/lib/mutant/mutator/node/rescue.rb +2 -19
- data/lib/mutant/mutator/node/return.rb +0 -3
- data/lib/mutant/mutator/node/sclass.rb +20 -0
- data/lib/mutant/mutator/node/send.rb +3 -62
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -9
- data/lib/mutant/mutator/node/send/binary.rb +0 -11
- data/lib/mutant/mutator/node/send/conditional.rb +0 -3
- data/lib/mutant/mutator/node/splat.rb +0 -3
- data/lib/mutant/mutator/node/super.rb +0 -3
- data/lib/mutant/mutator/node/when.rb +0 -19
- data/lib/mutant/mutator/node/yield.rb +0 -3
- data/lib/mutant/mutator/node/zsuper.rb +0 -3
- data/lib/mutant/mutator/util/array.rb +0 -6
- data/lib/mutant/mutator/util/symbol.rb +0 -3
- data/lib/mutant/parallel.rb +0 -13
- data/lib/mutant/parallel/driver.rb +0 -10
- data/lib/mutant/parallel/worker.rb +0 -22
- data/lib/mutant/registry.rb +2 -7
- data/lib/mutant/reporter/cli.rb +0 -5
- data/lib/mutant/reporter/cli/format.rb +1 -10
- data/lib/mutant/reporter/cli/printer.rb +0 -40
- data/lib/mutant/reporter/cli/printer/env_progress.rb +0 -15
- data/lib/mutant/reporter/cli/printer/isolation_result.rb +0 -18
- data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -5
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +0 -21
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +0 -8
- data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -9
- data/lib/mutant/repository/diff.rb +1 -13
- data/lib/mutant/repository/diff/ranges.rb +0 -11
- data/lib/mutant/result.rb +0 -3
- data/lib/mutant/runner.rb +0 -18
- data/lib/mutant/runner/sink.rb +0 -5
- data/lib/mutant/subject.rb +0 -8
- data/lib/mutant/subject/method.rb +0 -3
- data/lib/mutant/subject/method/instance.rb +0 -5
- data/lib/mutant/subject/method/metaclass.rb +30 -0
- data/lib/mutant/transform.rb +0 -92
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warnings.rb +0 -6
- data/lib/mutant/zombifier.rb +4 -34
- data/meta/and.rb +0 -2
- data/meta/array.rb +0 -3
- data/meta/begin.rb +0 -3
- data/meta/block.rb +0 -3
- data/meta/break.rb +0 -1
- data/meta/case.rb +0 -6
- data/meta/casgn.rb +0 -3
- data/meta/cvasgn.rb +0 -1
- data/meta/def.rb +0 -7
- data/meta/ensure.rb +0 -1
- data/meta/false.rb +0 -1
- data/meta/gvasgn.rb +0 -1
- data/meta/hash.rb +0 -4
- data/meta/if.rb +0 -5
- data/meta/ivasgn.rb +0 -1
- data/meta/kwbegin.rb +0 -1
- data/meta/lvasgn.rb +0 -1
- data/meta/match_current_line.rb +0 -1
- data/meta/next.rb +0 -1
- data/meta/or.rb +0 -2
- data/meta/regexp.rb +0 -1
- data/meta/rescue.rb +0 -6
- data/meta/sclass.rb +12 -0
- data/meta/send.rb +0 -4
- data/meta/true.rb +0 -1
- data/meta/until.rb +0 -1
- data/meta/while.rb +0 -2
- data/meta/yield.rb +0 -1
- data/mutant.gemspec +4 -3
- data/mutant.sh +12 -0
- data/spec/integrations.yml +3 -1
- data/spec/support/corpus.rb +3 -3
- data/spec/support/ruby_vm.rb +1 -2
- data/spec/support/shared_context.rb +3 -3
- data/spec/support/xspec.rb +2 -2
- data/spec/unit/mutant/ast/find_metaclass_containing_spec.rb +64 -0
- data/spec/unit/mutant/expression/methods_spec.rb +7 -2
- data/spec/unit/mutant/license_spec.rb +17 -5
- data/spec/unit/mutant/matcher/method/metaclass_spec.rb +108 -0
- data/spec/unit/mutant/matcher/methods/metaclass_spec.rb +62 -0
- data/spec/unit/mutant/matcher/namespace_spec.rb +3 -1
- data/spec/unit/mutant/matcher/scope_spec.rb +11 -1
- data/spec/unit/mutant/meta/example_spec.rb +3 -3
- data/spec/unit/mutant/mutator/node_spec.rb +1 -6
- data/spec/unit/mutant/parallel/driver_spec.rb +4 -4
- data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
- data/spec/unit/mutant/parallel_spec.rb +7 -7
- data/spec/unit/mutant/registry_spec.rb +52 -25
- data/spec/unit/mutant/repository/diff/ranges_spec.rb +2 -2
- data/spec/unit/mutant/subject/method/metaclass_spec.rb +63 -0
- data/test_app/lib/test_app.rb +1 -0
- data/test_app/lib/test_app/metaclasses.rb +108 -0
- metadata +43 -16
- data/.circleci/config.yml +0 -53
- data/lib/mutant/variable.rb +0 -282
- data/spec/unit/mutant/variable_spec.rb +0 -618
data/lib/mutant/zombifier.rb
CHANGED
@@ -17,7 +17,9 @@ module Mutant
|
|
17
17
|
|
18
18
|
include AST::Sexp
|
19
19
|
|
20
|
+
# rubocop:disable Lint/InheritException
|
20
21
|
LoadError = Class.new(::LoadError)
|
22
|
+
# rubocop:enable Lint/InheritException
|
21
23
|
|
22
24
|
# Initialize object
|
23
25
|
#
|
@@ -40,32 +42,20 @@ module Mutant
|
|
40
42
|
|
41
43
|
private
|
42
44
|
|
43
|
-
|
45
|
+
attr_reader :original
|
46
|
+
private :original
|
44
47
|
#
|
45
48
|
# @return [Method]
|
46
|
-
attr_reader :original
|
47
49
|
|
48
|
-
# Run zombifier
|
49
|
-
#
|
50
|
-
# @return [undefined]
|
51
50
|
def call
|
52
51
|
@original = require_highjack.call(method(:require))
|
53
52
|
require(root_require)
|
54
53
|
end
|
55
54
|
|
56
|
-
# Test if logical name is subjected to zombification
|
57
|
-
#
|
58
|
-
# @param [String]
|
59
55
|
def include?(logical_name)
|
60
56
|
!@zombified.include?(logical_name) && includes =~ logical_name
|
61
57
|
end
|
62
58
|
|
63
|
-
# Require file in zombie namespace
|
64
|
-
#
|
65
|
-
# @param [#to_s] logical_name
|
66
|
-
#
|
67
|
-
# @return [Bool]
|
68
|
-
# true if successful and false if feature already loaded
|
69
59
|
def require(logical_name)
|
70
60
|
logical_name = logical_name.to_s
|
71
61
|
loaded = original.call(logical_name)
|
@@ -75,14 +65,6 @@ module Mutant
|
|
75
65
|
true
|
76
66
|
end
|
77
67
|
|
78
|
-
# Find file by logical path
|
79
|
-
#
|
80
|
-
# @param [String] logical_name
|
81
|
-
#
|
82
|
-
# @return [File]
|
83
|
-
#
|
84
|
-
# @raise [LoadError]
|
85
|
-
# otherwise
|
86
68
|
def find(logical_name)
|
87
69
|
file_name = "#{logical_name}.rb"
|
88
70
|
|
@@ -94,13 +76,6 @@ module Mutant
|
|
94
76
|
fail LoadError, "Cannot find file #{file_name.inspect} in load path"
|
95
77
|
end
|
96
78
|
|
97
|
-
# Zombify contents of file
|
98
|
-
#
|
99
|
-
# Probably the 2nd valid use of eval ever. (First one is inserting mutants!).
|
100
|
-
#
|
101
|
-
# @param [Pathname] source_path
|
102
|
-
#
|
103
|
-
# @return [undefined]
|
104
79
|
def zombify(source_path)
|
105
80
|
kernel.eval(
|
106
81
|
Unparser.unparse(namespaced_node(source_path)),
|
@@ -109,11 +84,6 @@ module Mutant
|
|
109
84
|
)
|
110
85
|
end
|
111
86
|
|
112
|
-
# Namespaced root node
|
113
|
-
#
|
114
|
-
# @param [Pathname] source_path
|
115
|
-
#
|
116
|
-
# @return [Parser::AST::Node]
|
117
87
|
def namespaced_node(source_path)
|
118
88
|
s(:module, s(:const, nil, namespace), Unparser.parse(source_path.read))
|
119
89
|
end
|
data/meta/and.rb
CHANGED
data/meta/array.rb
CHANGED
@@ -6,7 +6,6 @@ Mutant::Meta::Example.add :array do
|
|
6
6
|
singleton_mutations
|
7
7
|
mutation 'true'
|
8
8
|
mutation '[false]'
|
9
|
-
mutation '[nil]'
|
10
9
|
mutation '[]'
|
11
10
|
end
|
12
11
|
|
@@ -16,9 +15,7 @@ Mutant::Meta::Example.add :array do
|
|
16
15
|
singleton_mutations
|
17
16
|
|
18
17
|
# Mutation of each element in array
|
19
|
-
mutation '[nil, false]'
|
20
18
|
mutation '[false, false]'
|
21
|
-
mutation '[true, nil]'
|
22
19
|
mutation '[true, true]'
|
23
20
|
|
24
21
|
# Remove each element of array once
|
data/meta/begin.rb
CHANGED
@@ -6,8 +6,6 @@ Mutant::Meta::Example.add :begin do
|
|
6
6
|
# Mutation of each statement in block
|
7
7
|
mutation 'true; true'
|
8
8
|
mutation 'false; false'
|
9
|
-
mutation 'nil; false'
|
10
|
-
mutation 'true; nil'
|
11
9
|
|
12
10
|
# Delete each statement
|
13
11
|
mutation 'true'
|
@@ -18,6 +16,5 @@ Mutant::Meta::Example.add :begin do
|
|
18
16
|
|
19
17
|
source s(:begin, s(:true))
|
20
18
|
# Mutation of each statement in block
|
21
|
-
mutation s(:begin, s(:nil))
|
22
19
|
mutation s(:begin, s(:false))
|
23
20
|
end
|
data/meta/block.rb
CHANGED
@@ -108,7 +108,6 @@ Mutant::Meta::Example.add :block do
|
|
108
108
|
|
109
109
|
singleton_mutations
|
110
110
|
mutation 'foo { self << false }'
|
111
|
-
mutation 'foo { self << nil }'
|
112
111
|
mutation 'foo { nil << true }'
|
113
112
|
mutation 'foo { nil }'
|
114
113
|
mutation 'foo { self }'
|
@@ -134,7 +133,6 @@ Mutant::Meta::Example.add :block do
|
|
134
133
|
mutation 'foo { break if true }'
|
135
134
|
mutation 'foo { next if !true }'
|
136
135
|
mutation 'foo { next if false }'
|
137
|
-
mutation 'foo { next if nil }'
|
138
136
|
mutation 'foo { next }'
|
139
137
|
end
|
140
138
|
|
@@ -163,7 +161,6 @@ Mutant::Meta::Example.add :block do
|
|
163
161
|
mutation 'foo { nil if true }'
|
164
162
|
mutation 'foo { break if !true }'
|
165
163
|
mutation 'foo { break if false }'
|
166
|
-
mutation 'foo { break if nil }'
|
167
164
|
mutation 'foo { break }'
|
168
165
|
end
|
169
166
|
|
data/meta/break.rb
CHANGED
data/meta/case.rb
CHANGED
data/meta/casgn.rb
CHANGED
@@ -5,7 +5,6 @@ Mutant::Meta::Example.add :casgn do
|
|
5
5
|
|
6
6
|
mutation 'A__MUTANT__ = true'
|
7
7
|
mutation 'A = false'
|
8
|
-
mutation 'A = nil'
|
9
8
|
mutation 'remove_const :A'
|
10
9
|
end
|
11
10
|
|
@@ -14,7 +13,6 @@ Mutant::Meta::Example.add :casgn do
|
|
14
13
|
|
15
14
|
mutation 'self::A__MUTANT__ = true'
|
16
15
|
mutation 'self::A = false'
|
17
|
-
mutation 'self::A = nil'
|
18
16
|
mutation 'self.remove_const :A'
|
19
17
|
end
|
20
18
|
|
@@ -24,5 +22,4 @@ Mutant::Meta::Example.add :casgn do
|
|
24
22
|
singleton_mutations
|
25
23
|
mutation 'A__MUTANT__ &&= true'
|
26
24
|
mutation 'A &&= false'
|
27
|
-
mutation 'A &&= nil'
|
28
25
|
end
|
data/meta/cvasgn.rb
CHANGED
data/meta/def.rb
CHANGED
@@ -56,8 +56,6 @@ Mutant::Meta::Example.add :def do
|
|
56
56
|
# Mutation of each statement in block
|
57
57
|
mutation 'def foo; true; true; end'
|
58
58
|
mutation 'def foo; false; false; end'
|
59
|
-
mutation 'def foo; true; nil; end'
|
60
|
-
mutation 'def foo; nil; false; end'
|
61
59
|
|
62
60
|
# Remove statement in block
|
63
61
|
mutation 'def foo; true; end'
|
@@ -97,7 +95,6 @@ Mutant::Meta::Example.add :def do
|
|
97
95
|
mutation 'def foo(a, b = nil); end'
|
98
96
|
mutation 'def foo; true; end'
|
99
97
|
mutation 'def foo(a, b = nil); raise; end'
|
100
|
-
mutation 'def foo(a, b = nil); nil; end'
|
101
98
|
mutation 'def foo(a, b = nil); false; end'
|
102
99
|
mutation 'def foo(a); true; end'
|
103
100
|
mutation 'def foo(a, b = nil); b = nil; true; end'
|
@@ -118,7 +115,6 @@ end
|
|
118
115
|
Mutant::Meta::Example.add :def do
|
119
116
|
source 'def foo(_unused = true); end'
|
120
117
|
|
121
|
-
mutation 'def foo(_unused = nil); end'
|
122
118
|
mutation 'def foo(_unused = false); end'
|
123
119
|
mutation 'def foo(_unused = true); raise; end'
|
124
120
|
mutation 'def foo(_unused); end'
|
@@ -154,7 +150,6 @@ Mutant::Meta::Example.add :def do
|
|
154
150
|
mutation 'def foo(a); end'
|
155
151
|
mutation 'def foo(); end'
|
156
152
|
mutation 'def foo(a = false); end'
|
157
|
-
mutation 'def foo(a = nil); end'
|
158
153
|
mutation 'def foo(_a = true); end'
|
159
154
|
mutation 'def foo(a = true); raise; end'
|
160
155
|
mutation 'def foo(a = true); a = true; end'
|
@@ -167,8 +162,6 @@ Mutant::Meta::Example.add :def do
|
|
167
162
|
# Body presence mutation
|
168
163
|
mutation 'def self.foo; false; false; end'
|
169
164
|
mutation 'def self.foo; true; true; end'
|
170
|
-
mutation 'def self.foo; true; nil; end'
|
171
|
-
mutation 'def self.foo; nil; false; end'
|
172
165
|
|
173
166
|
# Body presence mutation
|
174
167
|
mutation 'def self.foo; true; end'
|
data/meta/ensure.rb
CHANGED
data/meta/false.rb
CHANGED
data/meta/gvasgn.rb
CHANGED
data/meta/hash.rb
CHANGED
@@ -7,13 +7,9 @@ Mutant::Meta::Example.add :hash do
|
|
7
7
|
|
8
8
|
# Mutation of each key and value in hash
|
9
9
|
mutation '{ false => true , false => false }'
|
10
|
-
mutation '{ nil => true , false => false }'
|
11
10
|
mutation '{ true => false , false => false }'
|
12
|
-
mutation '{ true => nil , false => false }'
|
13
11
|
mutation '{ true => true , true => false }'
|
14
|
-
mutation '{ true => true , nil => false }'
|
15
12
|
mutation '{ true => true , false => true }'
|
16
|
-
mutation '{ true => true , false => nil }'
|
17
13
|
|
18
14
|
# Remove each key once
|
19
15
|
mutation '{ true => true }'
|
data/meta/if.rb
CHANGED
@@ -28,11 +28,9 @@ Mutant::Meta::Example.add :if do
|
|
28
28
|
|
29
29
|
# mutation of if body
|
30
30
|
mutation 'if condition; false; else false; end'
|
31
|
-
mutation 'if condition; nil; else false; end'
|
32
31
|
|
33
32
|
# mutation of else body
|
34
33
|
mutation 'if condition; true; else true; end'
|
35
|
-
mutation 'if condition; true; else nil; end'
|
36
34
|
end
|
37
35
|
|
38
36
|
Mutant::Meta::Example.add :if do
|
@@ -41,7 +39,6 @@ Mutant::Meta::Example.add :if do
|
|
41
39
|
singleton_mutations
|
42
40
|
mutation 'if !condition; true; end'
|
43
41
|
mutation 'if condition; false; end'
|
44
|
-
mutation 'if condition; nil; end'
|
45
42
|
mutation 'if true; true; end'
|
46
43
|
mutation 'if false; true; end'
|
47
44
|
mutation 'if nil; true; end'
|
@@ -57,7 +54,6 @@ Mutant::Meta::Example.add :if do
|
|
57
54
|
mutation 'unless true; true; end'
|
58
55
|
mutation 'unless false; true; end'
|
59
56
|
mutation 'unless condition; false; end'
|
60
|
-
mutation 'unless condition; nil; end'
|
61
57
|
mutation 'if condition; true; end'
|
62
58
|
mutation 'true'
|
63
59
|
end
|
@@ -68,7 +64,6 @@ Mutant::Meta::Example.add :if do
|
|
68
64
|
singleton_mutations
|
69
65
|
mutation 'false if /foo/'
|
70
66
|
mutation 'true if //'
|
71
|
-
mutation 'nil if /foo/'
|
72
67
|
mutation 'true if true'
|
73
68
|
mutation 'true if false'
|
74
69
|
mutation 'true if nil'
|
data/meta/ivasgn.rb
CHANGED
data/meta/kwbegin.rb
CHANGED
data/meta/lvasgn.rb
CHANGED
data/meta/match_current_line.rb
CHANGED
data/meta/next.rb
CHANGED
data/meta/or.rb
CHANGED
data/meta/regexp.rb
CHANGED
data/meta/rescue.rb
CHANGED
@@ -8,7 +8,6 @@ Mutant::Meta::Example.add :rescue do
|
|
8
8
|
mutation 'begin; rescue self, ExceptionB => error; true; end'
|
9
9
|
mutation 'begin; rescue ExceptionA, self => error; true; end'
|
10
10
|
mutation 'begin; rescue ExceptionA, ExceptionB => error; false; end'
|
11
|
-
mutation 'begin; rescue ExceptionA, ExceptionB => error; nil; end'
|
12
11
|
mutation 'begin; true; end'
|
13
12
|
|
14
13
|
end
|
@@ -19,7 +18,6 @@ Mutant::Meta::Example.add :rescue do
|
|
19
18
|
singleton_mutations
|
20
19
|
mutation 'begin; rescue SomeException; true; end'
|
21
20
|
mutation 'begin; rescue SomeException => error; false; end'
|
22
|
-
mutation 'begin; rescue SomeException => error; nil; end'
|
23
21
|
mutation 'begin; rescue self => error; true; end'
|
24
22
|
mutation 'begin; true; end'
|
25
23
|
end
|
@@ -29,7 +27,6 @@ Mutant::Meta::Example.add :rescue do
|
|
29
27
|
|
30
28
|
singleton_mutations
|
31
29
|
mutation 'begin; rescue => error; false; end'
|
32
|
-
mutation 'begin; rescue => error; nil; end'
|
33
30
|
mutation 'begin; rescue; true; end'
|
34
31
|
mutation 'begin; true; end'
|
35
32
|
end
|
@@ -39,7 +36,6 @@ Mutant::Meta::Example.add :rescue do
|
|
39
36
|
|
40
37
|
singleton_mutations
|
41
38
|
mutation 'begin; rescue; false; end'
|
42
|
-
mutation 'begin; rescue; nil; end'
|
43
39
|
mutation 'begin; true end'
|
44
40
|
end
|
45
41
|
|
@@ -48,7 +44,6 @@ Mutant::Meta::Example.add :rescue do
|
|
48
44
|
|
49
45
|
singleton_mutations
|
50
46
|
mutation 'begin; false; end'
|
51
|
-
mutation 'begin; nil; end'
|
52
47
|
end
|
53
48
|
|
54
49
|
Mutant::Meta::Example.add :rescue do
|
@@ -86,5 +81,4 @@ Mutant::Meta::Example.add :rescue do
|
|
86
81
|
|
87
82
|
singleton_mutations
|
88
83
|
mutation 'begin; rescue; ensure; false; end'
|
89
|
-
mutation 'begin; rescue; ensure; nil; end'
|
90
84
|
end
|
data/meta/sclass.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Mutant::Meta::Example.add :sclass do
|
4
|
+
source 'class << self; bar; end'
|
5
|
+
|
6
|
+
mutation 'class << self; nil; end'
|
7
|
+
mutation 'class << self; self; end'
|
8
|
+
end
|
9
|
+
|
10
|
+
Mutant::Meta::Example.add :sclass do
|
11
|
+
source 'class << self; end'
|
12
|
+
end
|
data/meta/send.rb
CHANGED
@@ -5,7 +5,6 @@ Mutant::Meta::Example.add :send do
|
|
5
5
|
|
6
6
|
singleton_mutations
|
7
7
|
mutation 'a == b'
|
8
|
-
mutation 'a >= b'
|
9
8
|
mutation 'a.eql?(b)'
|
10
9
|
mutation 'a.equal?(b)'
|
11
10
|
mutation 'nil > b'
|
@@ -90,7 +89,6 @@ Mutant::Meta::Example.add :send do
|
|
90
89
|
|
91
90
|
singleton_mutations
|
92
91
|
mutation 'a == b'
|
93
|
-
mutation 'a <= b'
|
94
92
|
mutation 'a.eql?(b)'
|
95
93
|
mutation 'a.equal?(b)'
|
96
94
|
mutation 'nil < b'
|
@@ -488,9 +486,7 @@ end
|
|
488
486
|
mutation 'true'
|
489
487
|
mutation 'false'
|
490
488
|
mutation "false #{operator} false"
|
491
|
-
mutation "nil #{operator} false"
|
492
489
|
mutation "true #{operator} true"
|
493
|
-
mutation "true #{operator} nil"
|
494
490
|
end
|
495
491
|
end
|
496
492
|
|