mutant 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/lib/mutant/cli.rb +9 -12
- data/lib/mutant/matcher/method.rb +4 -9
- data/lib/mutant/matcher/method/instance.rb +1 -5
- data/lib/mutant/matcher/method/singleton.rb +5 -25
- data/lib/mutant/mutation.rb +1 -5
- data/lib/mutant/mutation/evil.rb +1 -5
- data/lib/mutant/mutator.rb +1 -4
- data/lib/mutant/mutator/node/argument.rb +1 -5
- data/lib/mutant/mutator/node/send.rb +3 -2
- data/lib/mutant/mutator/util.rb +1 -5
- data/lib/mutant/reporter/cli/printer.rb +4 -16
- data/lib/mutant/reporter/cli/progress/config.rb +3 -3
- data/lib/mutant/runner.rb +2 -10
- data/lib/mutant/runner/config.rb +1 -5
- data/lib/mutant/runner/mutation.rb +1 -5
- data/lib/mutant/runner/subject.rb +1 -5
- data/lib/mutant/subject/method.rb +1 -5
- data/lib/mutant/subject/method/instance.rb +1 -5
- data/lib/mutant/subject/method/singleton.rb +1 -5
- data/lib/mutant/version.rb +1 -1
- data/meta/send.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12466470fce5fafd680059de82205c093d93c503
|
4
|
+
data.tar.gz: c374d20379cb9c81068ce205a6d43d7ddd3505ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cf3581a8648769d72db4a2cee7522ebece339eef403af542c989cbac811cc3deb34fe03f25795ad80d3a9c5fa12fedc796dda3bc59565b282c1afba311302a3
|
7
|
+
data.tar.gz: 61deff160b2dca8288d53a615c8c4ff5a5005612d47383d6f1d1145d6b28eb1eae898d3634e6c16eb02b837b8549fe86834a96c8a015da98a1eaeaf91845a580
|
data/Changelog.md
CHANGED
data/lib/mutant/cli.rb
CHANGED
@@ -180,17 +180,7 @@ module Mutant
|
|
180
180
|
@strategy = Strategy::Null.new
|
181
181
|
@cache = Mutant::Cache.new
|
182
182
|
parse(arguments)
|
183
|
-
config
|
184
|
-
end
|
185
|
-
|
186
|
-
# Return config
|
187
|
-
#
|
188
|
-
# @return [Config]
|
189
|
-
#
|
190
|
-
# @api private
|
191
|
-
#
|
192
|
-
def config
|
193
|
-
Config.new(
|
183
|
+
@config = Config.new(
|
194
184
|
cache: @cache,
|
195
185
|
zombie: @zombie,
|
196
186
|
debug: @debug,
|
@@ -201,7 +191,14 @@ module Mutant
|
|
201
191
|
expected_coverage: @expected_coverage
|
202
192
|
)
|
203
193
|
end
|
204
|
-
|
194
|
+
|
195
|
+
# Return config
|
196
|
+
#
|
197
|
+
# @return [Config]
|
198
|
+
#
|
199
|
+
# @api private
|
200
|
+
#
|
201
|
+
attr_reader :config
|
205
202
|
|
206
203
|
private
|
207
204
|
|
@@ -6,9 +6,8 @@ module Mutant
|
|
6
6
|
include Equalizer.new(:identification)
|
7
7
|
|
8
8
|
# Methods within rbx kernel directory are precompiled and their source
|
9
|
-
# cannot be accessed via reading source location
|
10
|
-
|
11
|
-
BLACKLIST = /\A#{Regexp.union(*SKIP_METHODS)}/.freeze
|
9
|
+
# cannot be accessed via reading source location. Same for methods created by eval.
|
10
|
+
BLACKLIST = %r{\Akernel/|(eval)}.freeze
|
12
11
|
|
13
12
|
# Enumerate matches
|
14
13
|
#
|
@@ -32,13 +31,9 @@ module Mutant
|
|
32
31
|
|
33
32
|
private
|
34
33
|
|
35
|
-
# Test if method
|
34
|
+
# Test if method should be skipped
|
36
35
|
#
|
37
|
-
# @return [
|
38
|
-
# true and print warning if location must be filtered
|
39
|
-
#
|
40
|
-
# @return [false]
|
41
|
-
# otherwise
|
36
|
+
# @return [Boolean]
|
42
37
|
#
|
43
38
|
# @api private
|
44
39
|
#
|
@@ -26,11 +26,7 @@ module Mutant
|
|
26
26
|
#
|
27
27
|
# @param [Parser::AST::Node] node
|
28
28
|
#
|
29
|
-
# @return [
|
30
|
-
# if node matches method
|
31
|
-
#
|
32
|
-
# @return [false]
|
33
|
-
# otherwise
|
29
|
+
# @return [Boolean]
|
34
30
|
#
|
35
31
|
# @api private
|
36
32
|
#
|
@@ -42,11 +38,7 @@ module Mutant
|
|
42
38
|
#
|
43
39
|
# @param [Parser::AST::Node] node
|
44
40
|
#
|
45
|
-
# @return [
|
46
|
-
# if node matches source line
|
47
|
-
#
|
48
|
-
# @return [false]
|
49
|
-
# otherwise
|
41
|
+
# @return [Boolean]
|
50
42
|
#
|
51
43
|
# @api private
|
52
44
|
#
|
@@ -60,11 +52,7 @@ module Mutant
|
|
60
52
|
#
|
61
53
|
# @param [Parser::AST::Node] node
|
62
54
|
#
|
63
|
-
# @return [
|
64
|
-
# if node name matches
|
65
|
-
#
|
66
|
-
# @return [false]
|
67
|
-
# otherwise
|
55
|
+
# @return [Boolean]
|
68
56
|
#
|
69
57
|
# @api private
|
70
58
|
#
|
@@ -76,11 +64,7 @@ module Mutant
|
|
76
64
|
#
|
77
65
|
# @param [Parser::AST::Node] node
|
78
66
|
#
|
79
|
-
# @return [
|
80
|
-
# when receiver matches
|
81
|
-
#
|
82
|
-
# @return [false]
|
83
|
-
# otherwise
|
67
|
+
# @return [Boolean]
|
84
68
|
#
|
85
69
|
# @api private
|
86
70
|
#
|
@@ -105,11 +89,7 @@ module Mutant
|
|
105
89
|
#
|
106
90
|
# @param [Parser::AST::Node] node
|
107
91
|
#
|
108
|
-
# @return [
|
109
|
-
# if node name matches unqualified scope name
|
110
|
-
#
|
111
|
-
# @return [false]
|
112
|
-
# otherwise
|
92
|
+
# @return [Boolean]
|
113
93
|
#
|
114
94
|
# @api private
|
115
95
|
#
|
data/lib/mutant/mutation.rb
CHANGED
data/lib/mutant/mutation/evil.rb
CHANGED
data/lib/mutant/mutator.rb
CHANGED
@@ -170,8 +170,9 @@ module Mutant
|
|
170
170
|
#
|
171
171
|
def emit_implicit_self
|
172
172
|
emit_receiver(nil) if n_self?(receiver) && !(
|
173
|
-
KEYWORDS.include?(selector)
|
174
|
-
|
173
|
+
KEYWORDS.include?(selector) ||
|
174
|
+
METHOD_OPERATORS.include?(selector) ||
|
175
|
+
OP_ASSIGN.include?(parent_type) ||
|
175
176
|
attribute_assignment?
|
176
177
|
)
|
177
178
|
end
|
data/lib/mutant/mutator/util.rb
CHANGED
@@ -83,11 +83,7 @@ module Mutant
|
|
83
83
|
|
84
84
|
# Test if runner was successful
|
85
85
|
#
|
86
|
-
# @return [
|
87
|
-
# if runner is successful
|
88
|
-
#
|
89
|
-
# @return [false]
|
90
|
-
# otherwise
|
86
|
+
# @return [Boolean]
|
91
87
|
#
|
92
88
|
# @api private
|
93
89
|
#
|
@@ -95,13 +91,9 @@ module Mutant
|
|
95
91
|
object.success?
|
96
92
|
end
|
97
93
|
|
98
|
-
# Test
|
99
|
-
#
|
100
|
-
# @return [true]
|
101
|
-
# if output is colored
|
94
|
+
# Test if output can be colored
|
102
95
|
#
|
103
|
-
# @return [
|
104
|
-
# otherwise
|
96
|
+
# @return [Boolean]
|
105
97
|
#
|
106
98
|
# @api private
|
107
99
|
#
|
@@ -127,11 +119,7 @@ module Mutant
|
|
127
119
|
|
128
120
|
# Test for output to tty
|
129
121
|
#
|
130
|
-
# @return [
|
131
|
-
# if output is a tty
|
132
|
-
#
|
133
|
-
# @return [false]
|
134
|
-
# otherwise
|
122
|
+
# @return [Boolean]
|
135
123
|
#
|
136
124
|
# @api private
|
137
125
|
#
|
@@ -20,9 +20,9 @@ module Mutant
|
|
20
20
|
def run
|
21
21
|
if running?
|
22
22
|
info 'Mutant configuration:'
|
23
|
-
info 'Matcher: %s',
|
24
|
-
info 'Strategy: %s',
|
25
|
-
info 'Expect Coverage: %
|
23
|
+
info 'Matcher: %s', config.matcher.inspect
|
24
|
+
info 'Strategy: %s', config.strategy.inspect
|
25
|
+
info 'Expect Coverage: %0.2f%%', config.expected_coverage.inspect
|
26
26
|
end
|
27
27
|
self
|
28
28
|
end
|
data/lib/mutant/runner.rb
CHANGED
@@ -91,11 +91,7 @@ module Mutant
|
|
91
91
|
|
92
92
|
# Test if runner should stop
|
93
93
|
#
|
94
|
-
# @return [
|
95
|
-
# if runner should stop
|
96
|
-
#
|
97
|
-
# @return [false]
|
98
|
-
# otherwise
|
94
|
+
# @return [Boolean]
|
99
95
|
#
|
100
96
|
# @api private
|
101
97
|
#
|
@@ -115,11 +111,7 @@ module Mutant
|
|
115
111
|
|
116
112
|
# Test if runner is successful
|
117
113
|
#
|
118
|
-
# @return [
|
119
|
-
# if successful
|
120
|
-
#
|
121
|
-
# @return [false]
|
122
|
-
# otherwise
|
114
|
+
# @return [Boolean]
|
123
115
|
#
|
124
116
|
# @api private
|
125
117
|
#
|
data/lib/mutant/runner/config.rb
CHANGED
data/lib/mutant/version.rb
CHANGED
data/meta/send.rb
CHANGED
@@ -235,6 +235,16 @@ Mutant::Meta::Example.add do
|
|
235
235
|
mutation 'foo[]'
|
236
236
|
end
|
237
237
|
|
238
|
+
Mutant::Meta::Example.add do
|
239
|
+
source 'self[foo]'
|
240
|
+
|
241
|
+
singleton_mutations
|
242
|
+
mutation 'self[self]'
|
243
|
+
mutation 'self[nil]'
|
244
|
+
mutation 'self[]'
|
245
|
+
mutation 'foo'
|
246
|
+
end
|
247
|
+
|
238
248
|
Mutant::Meta::Example.add do
|
239
249
|
source 'foo[*bar]'
|
240
250
|
|