mutant 0.9.5 → 0.9.10
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/.rubocop.yml +203 -0
- data/Changelog.md +27 -0
- data/Gemfile +0 -7
- data/Gemfile.lock +30 -87
- data/Gemfile.shared +7 -0
- data/README.md +88 -27
- data/config/reek.yml +1 -0
- data/lib/mutant.rb +5 -3
- 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 +5 -49
- data/lib/mutant/config.rb +0 -8
- data/lib/mutant/context.rb +0 -3
- 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/example/dsl.rb +0 -21
- data/lib/mutant/meta/example/verification.rb +0 -20
- 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 -67
- 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 +1 -7
- 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 +2 -61
- 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 +0 -9
- data/lib/mutant/reporter/cli/printer.rb +2 -42
- 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 +1 -22
- 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 +40 -6
- 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 +2 -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/range.rb +26 -0
- 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 +8 -4
- data/mutant.sh +12 -0
- data/spec/integrations.yml +3 -1
- data/spec/spec_helper.rb +37 -22
- 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/reporter/cli/printer/env_result_spec.rb +1 -1
- data/spec/unit/mutant/reporter/cli/printer/mutation_progress_result_spec.rb +2 -2
- data/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb +12 -12
- data/spec/unit/mutant/reporter/cli/printer/subject_result_spec.rb +1 -1
- data/spec/unit/mutant/reporter/cli/printer_spec.rb +4 -4
- data/spec/unit/mutant/reporter/cli_spec.rb +1 -1
- data/spec/unit/mutant/subject/method/instance_spec.rb +117 -22
- data/spec/unit/mutant/subject/method/metaclass_spec.rb +63 -0
- data/test_app/Gemfile.minitest +2 -0
- data/test_app/lib/test_app.rb +5 -0
- data/test_app/lib/test_app/metaclasses.rb +108 -0
- metadata +85 -25
- data/.circleci/config.yml +0 -53
- data/config/rubocop.yml +0 -205
- data/lib/mutant/color.rb +0 -43
- data/lib/mutant/diff.rb +0 -114
- data/lib/mutant/variable.rb +0 -282
- data/spec/shared/base_behavior.rb +0 -45
- data/spec/support/test_app.rb +0 -7
- data/spec/support/warnings.yml +0 -6
- data/spec/unit/mutant/diff_spec.rb +0 -189
- data/spec/unit/mutant/variable_spec.rb +0 -618
data/lib/mutant/version.rb
CHANGED
data/lib/mutant/warnings.rb
CHANGED
@@ -92,9 +92,6 @@ module Mutant
|
|
92
92
|
|
93
93
|
private
|
94
94
|
|
95
|
-
# Hook called when capturing a warning
|
96
|
-
#
|
97
|
-
# @return [undefined]
|
98
95
|
def capture(*arguments)
|
99
96
|
if @disabled
|
100
97
|
@original.call(*arguments)
|
@@ -103,9 +100,6 @@ module Mutant
|
|
103
100
|
end
|
104
101
|
end
|
105
102
|
|
106
|
-
# Assert warnings capture does not call itself
|
107
|
-
#
|
108
|
-
# Its currently not supported nor intended to be supported.
|
109
103
|
def assert_no_recursion
|
110
104
|
fail RecursiveUseError unless @disabled
|
111
105
|
end
|
data/lib/mutant/zombifier.rb
CHANGED
@@ -42,32 +42,20 @@ module Mutant
|
|
42
42
|
|
43
43
|
private
|
44
44
|
|
45
|
-
|
45
|
+
attr_reader :original
|
46
|
+
private :original
|
46
47
|
#
|
47
48
|
# @return [Method]
|
48
|
-
attr_reader :original
|
49
49
|
|
50
|
-
# Run zombifier
|
51
|
-
#
|
52
|
-
# @return [undefined]
|
53
50
|
def call
|
54
51
|
@original = require_highjack.call(method(:require))
|
55
52
|
require(root_require)
|
56
53
|
end
|
57
54
|
|
58
|
-
# Test if logical name is subjected to zombification
|
59
|
-
#
|
60
|
-
# @param [String]
|
61
55
|
def include?(logical_name)
|
62
56
|
!@zombified.include?(logical_name) && includes =~ logical_name
|
63
57
|
end
|
64
58
|
|
65
|
-
# Require file in zombie namespace
|
66
|
-
#
|
67
|
-
# @param [#to_s] logical_name
|
68
|
-
#
|
69
|
-
# @return [Bool]
|
70
|
-
# true if successful and false if feature already loaded
|
71
59
|
def require(logical_name)
|
72
60
|
logical_name = logical_name.to_s
|
73
61
|
loaded = original.call(logical_name)
|
@@ -77,14 +65,6 @@ module Mutant
|
|
77
65
|
true
|
78
66
|
end
|
79
67
|
|
80
|
-
# Find file by logical path
|
81
|
-
#
|
82
|
-
# @param [String] logical_name
|
83
|
-
#
|
84
|
-
# @return [File]
|
85
|
-
#
|
86
|
-
# @raise [LoadError]
|
87
|
-
# otherwise
|
88
68
|
def find(logical_name)
|
89
69
|
file_name = "#{logical_name}.rb"
|
90
70
|
|
@@ -96,13 +76,6 @@ module Mutant
|
|
96
76
|
fail LoadError, "Cannot find file #{file_name.inspect} in load path"
|
97
77
|
end
|
98
78
|
|
99
|
-
# Zombify contents of file
|
100
|
-
#
|
101
|
-
# Probably the 2nd valid use of eval ever. (First one is inserting mutants!).
|
102
|
-
#
|
103
|
-
# @param [Pathname] source_path
|
104
|
-
#
|
105
|
-
# @return [undefined]
|
106
79
|
def zombify(source_path)
|
107
80
|
kernel.eval(
|
108
81
|
Unparser.unparse(namespaced_node(source_path)),
|
@@ -111,11 +84,6 @@ module Mutant
|
|
111
84
|
)
|
112
85
|
end
|
113
86
|
|
114
|
-
# Namespaced root node
|
115
|
-
#
|
116
|
-
# @param [Pathname] source_path
|
117
|
-
#
|
118
|
-
# @return [Parser::AST::Node]
|
119
87
|
def namespaced_node(source_path)
|
120
88
|
s(:module, s(:const, nil, namespace), Unparser.parse(source_path.read))
|
121
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/range.rb
CHANGED
@@ -37,3 +37,29 @@ Mutant::Meta::Example.add :erange do
|
|
37
37
|
mutation '1...101'
|
38
38
|
mutation '1...-100'
|
39
39
|
end
|
40
|
+
|
41
|
+
unless RUBY_VERSION.start_with?('2.5')
|
42
|
+
Mutant::Meta::Example.add :erange do
|
43
|
+
source '1...'
|
44
|
+
|
45
|
+
singleton_mutations
|
46
|
+
mutation '-1...'
|
47
|
+
mutation '0...'
|
48
|
+
mutation '1..'
|
49
|
+
mutation '2...'
|
50
|
+
mutation 'nil...'
|
51
|
+
mutation 'self...'
|
52
|
+
end
|
53
|
+
|
54
|
+
Mutant::Meta::Example.add :irange do
|
55
|
+
source '1..'
|
56
|
+
|
57
|
+
singleton_mutations
|
58
|
+
mutation '-1..'
|
59
|
+
mutation '0..'
|
60
|
+
mutation '1...'
|
61
|
+
mutation '2..'
|
62
|
+
mutation 'nil..'
|
63
|
+
mutation 'self..'
|
64
|
+
end
|
65
|
+
end
|
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
|