mutant 0.8.13 → 0.8.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/Gemfile.lock +38 -36
- data/circle.yml +23 -7
- data/config/rubocop.yml +4 -1
- data/lib/mutant.rb +1 -1
- data/lib/mutant/ast/named_children.rb +1 -1
- data/lib/mutant/ast/regexp/transformer/text.rb +1 -0
- data/lib/mutant/ast/types.rb +1 -0
- data/lib/mutant/diff.rb +1 -1
- data/lib/mutant/expression.rb +1 -1
- data/lib/mutant/expression/methods.rb +1 -1
- data/lib/mutant/expression/namespace.rb +1 -1
- data/lib/mutant/matcher/method.rb +2 -2
- data/lib/mutant/matcher/method/instance.rb +1 -1
- data/lib/mutant/mutator/node.rb +5 -5
- data/lib/mutant/mutator/node/arguments.rb +1 -1
- data/lib/mutant/mutator/node/literal/{fixnum.rb → integer.rb} +5 -4
- data/lib/mutant/mutator/node/when.rb +1 -1
- data/lib/mutant/repository.rb +1 -1
- data/lib/mutant/result.rb +6 -6
- data/lib/mutant/subject.rb +2 -2
- data/lib/mutant/version.rb +1 -1
- data/meta/case.rb +0 -1
- data/mutant.gemspec +3 -4
- data/spec/integrations.yml +1 -1
- data/spec/shared/framework_integration_behavior.rb +10 -9
- data/spec/support/corpus.rb +16 -18
- data/spec/support/warning.rb +1 -1
- data/spec/support/warnings.yml +3 -2
- data/spec/unit/mutant/isolation/fork_spec.rb +1 -1
- data/spec/unit/mutant/loader_spec.rb +1 -1
- data/spec/unit/mutant/parallel/worker_spec.rb +1 -1
- data/spec/unit/mutant/subject/method/singleton_spec.rb +1 -2
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d897b5d56af6f58fd17934e406c2df2dc58639ab
|
4
|
+
data.tar.gz: 539f60b990eaff77ac170b9aa5065e1477dcaa86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6033ac17e6ff81f9a635a0d3ec093512aaef843fb318b2e80475abd9276f362864b8299bc24bbe832f0d485ec6707d2f97e451bec39676991db08d19d5c47776
|
7
|
+
data.tar.gz: b5ba1757ba52285d43c47969fd66aa01ad275ffdfcf8158f95fc7fa2184fba8f753ae6bafc5a5a9c38ca4e37dbca270feed3f5c9c6a7b537ccbb402b3c1b3060
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mutant (0.8.
|
4
|
+
mutant (0.8.13)
|
5
5
|
abstract_type (~> 0.0.7)
|
6
6
|
adamantium (~> 0.2.0)
|
7
7
|
anima (~> 0.3.0)
|
8
8
|
ast (~> 2.2)
|
9
9
|
concord (~> 0.1.5)
|
10
|
-
diff-lcs (~> 1.
|
10
|
+
diff-lcs (~> 1.3)
|
11
11
|
equalizer (~> 0.0.9)
|
12
12
|
ice_nine (~> 0.11.1)
|
13
13
|
memoizable (~> 0.4.2)
|
14
14
|
morpher (~> 0.2.6)
|
15
15
|
parallel (~> 1.3)
|
16
|
-
parser (
|
16
|
+
parser (>= 2.3.1.4, < 2.5)
|
17
17
|
procto (~> 0.0.2)
|
18
|
-
regexp_parser (~> 0.4.
|
18
|
+
regexp_parser (~> 0.4.3)
|
19
19
|
unparser (~> 0.2.5)
|
20
|
-
mutant-rspec (0.8.
|
21
|
-
mutant (~> 0.8.
|
20
|
+
mutant-rspec (0.8.13)
|
21
|
+
mutant (~> 0.8.13)
|
22
22
|
rspec-core (>= 3.4.0, < 3.7.0)
|
23
23
|
|
24
24
|
GEM
|
@@ -46,7 +46,8 @@ GEM
|
|
46
46
|
equalizer (~> 0.0.9)
|
47
47
|
descendants_tracker (0.0.4)
|
48
48
|
thread_safe (~> 0.3, >= 0.3.1)
|
49
|
-
devtools (0.1.
|
49
|
+
devtools (0.1.18)
|
50
|
+
abstract_type (~> 0.0.7)
|
50
51
|
adamantium (~> 0.2.0)
|
51
52
|
anima (~> 0.3.0)
|
52
53
|
concord (~> 0.1.5)
|
@@ -55,31 +56,31 @@ GEM
|
|
55
56
|
mutant (~> 0.8.11)
|
56
57
|
mutant-rspec (~> 0.8.11)
|
57
58
|
procto (~> 0.0.3)
|
58
|
-
rake (~>
|
59
|
-
reek (~> 4.
|
59
|
+
rake (~> 12.0.0)
|
60
|
+
reek (~> 4.6.0)
|
60
61
|
rspec (~> 3.5.0)
|
61
62
|
rspec-core (~> 3.5.4)
|
62
63
|
rspec-its (~> 1.2.0)
|
63
|
-
rubocop (~> 0.
|
64
|
-
simplecov (~> 0.
|
64
|
+
rubocop (~> 0.47.0)
|
65
|
+
simplecov (~> 0.14.0)
|
65
66
|
yard (~> 0.9.1)
|
66
67
|
yardstick (~> 0.9.9)
|
67
|
-
diff-lcs (1.
|
68
|
+
diff-lcs (1.3)
|
68
69
|
docile (1.1.5)
|
69
70
|
equalizer (0.0.11)
|
70
71
|
erubis (2.7.0)
|
71
|
-
ffi (1.9.
|
72
|
+
ffi (1.9.18)
|
72
73
|
flay (2.8.1)
|
73
74
|
erubis (~> 2.7.0)
|
74
75
|
path_expander (~> 1.0)
|
75
76
|
ruby_parser (~> 3.0)
|
76
77
|
sexp_processor (~> 4.0)
|
77
|
-
flog (4.4.
|
78
|
+
flog (4.4.1)
|
78
79
|
path_expander (~> 1.0)
|
79
80
|
ruby_parser (~> 3.1, > 3.1.0)
|
80
81
|
sexp_processor (~> 4.4)
|
81
82
|
ice_nine (0.11.2)
|
82
|
-
json (2.0
|
83
|
+
json (2.1.0)
|
83
84
|
memoizable (0.4.2)
|
84
85
|
thread_safe (~> 0.3, >= 0.3.1)
|
85
86
|
morpher (0.2.6)
|
@@ -91,19 +92,20 @@ GEM
|
|
91
92
|
equalizer (~> 0.0.9)
|
92
93
|
ice_nine (~> 0.11.0)
|
93
94
|
procto (~> 0.0.2)
|
94
|
-
parallel (1.
|
95
|
-
parser (2.
|
95
|
+
parallel (1.11.2)
|
96
|
+
parser (2.4.0.0)
|
96
97
|
ast (~> 2.2)
|
97
|
-
path_expander (1.0.
|
98
|
+
path_expander (1.0.2)
|
98
99
|
powerpack (0.1.1)
|
99
100
|
procto (0.0.3)
|
100
|
-
rainbow (2.
|
101
|
-
|
102
|
-
|
101
|
+
rainbow (2.2.2)
|
102
|
+
rake
|
103
|
+
rake (12.0.0)
|
104
|
+
reek (4.6.2)
|
103
105
|
codeclimate-engine-rb (~> 0.4.0)
|
104
|
-
parser (
|
106
|
+
parser (>= 2.4.0.0, < 2.5)
|
105
107
|
rainbow (~> 2.0)
|
106
|
-
regexp_parser (0.4.
|
108
|
+
regexp_parser (0.4.3)
|
107
109
|
rspec (3.5.0)
|
108
110
|
rspec-core (~> 3.5.0)
|
109
111
|
rspec-expectations (~> 3.5.0)
|
@@ -120,37 +122,37 @@ GEM
|
|
120
122
|
diff-lcs (>= 1.2.0, < 2.0)
|
121
123
|
rspec-support (~> 3.5.0)
|
122
124
|
rspec-support (3.5.0)
|
123
|
-
rubocop (0.
|
124
|
-
parser (>= 2.3.
|
125
|
+
rubocop (0.47.1)
|
126
|
+
parser (>= 2.3.3.1, < 3.0)
|
125
127
|
powerpack (~> 0.1)
|
126
128
|
rainbow (>= 1.99.1, < 3.0)
|
127
129
|
ruby-progressbar (~> 1.7)
|
128
130
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
129
131
|
ruby-progressbar (1.8.1)
|
130
|
-
ruby_parser (3.
|
132
|
+
ruby_parser (3.9.0)
|
131
133
|
sexp_processor (~> 4.1)
|
132
|
-
sexp_processor (4.
|
133
|
-
simplecov (0.
|
134
|
+
sexp_processor (4.9.0)
|
135
|
+
simplecov (0.14.1)
|
134
136
|
docile (~> 1.1.0)
|
135
137
|
json (>= 1.8, < 3)
|
136
138
|
simplecov-html (~> 0.10.0)
|
137
|
-
simplecov-html (0.10.
|
138
|
-
thread_safe (0.3.
|
139
|
-
unicode-display_width (1.
|
140
|
-
unparser (0.2.
|
139
|
+
simplecov-html (0.10.1)
|
140
|
+
thread_safe (0.3.6)
|
141
|
+
unicode-display_width (1.3.0)
|
142
|
+
unparser (0.2.6)
|
141
143
|
abstract_type (~> 0.0.7)
|
142
144
|
adamantium (~> 0.2.0)
|
143
145
|
concord (~> 0.1.5)
|
144
|
-
diff-lcs (~> 1.
|
146
|
+
diff-lcs (~> 1.3)
|
145
147
|
equalizer (~> 0.0.9)
|
146
|
-
parser (
|
148
|
+
parser (>= 2.3.1.2, < 2.5)
|
147
149
|
procto (~> 0.0.2)
|
148
150
|
virtus (1.0.5)
|
149
151
|
axiom-types (~> 0.1)
|
150
152
|
coercible (~> 1.0)
|
151
153
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
152
154
|
equalizer (~> 0.0, >= 0.0.9)
|
153
|
-
yard (0.9.
|
155
|
+
yard (0.9.9)
|
154
156
|
yardstick (0.9.9)
|
155
157
|
yard (~> 0.8, >= 0.8.7.2)
|
156
158
|
|
@@ -164,4 +166,4 @@ DEPENDENCIES
|
|
164
166
|
mutant!
|
165
167
|
|
166
168
|
BUNDLED WITH
|
167
|
-
1.
|
169
|
+
1.15.1
|
data/circle.yml
CHANGED
@@ -1,7 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
defaults: &defaults
|
2
|
+
working_directory: ~/mutant
|
3
|
+
steps:
|
4
|
+
- checkout
|
5
|
+
- run: bundle install
|
6
|
+
- run: bundle exec rake ci
|
7
|
+
|
8
|
+
version: 2
|
9
|
+
jobs:
|
10
|
+
ruby_2_3:
|
11
|
+
<<: *defaults
|
12
|
+
docker:
|
13
|
+
- image: circleci/ruby:2.3.3
|
14
|
+
ruby_2_4:
|
15
|
+
<<: *defaults
|
16
|
+
docker:
|
17
|
+
- image: circleci/ruby:2.4.1
|
18
|
+
workflows:
|
19
|
+
version: 2
|
20
|
+
test:
|
21
|
+
jobs:
|
22
|
+
- ruby_2_3
|
23
|
+
- ruby_2_4
|
data/config/rubocop.yml
CHANGED
@@ -96,7 +96,7 @@ SymbolArray:
|
|
96
96
|
|
97
97
|
# Align if/else blocks with the variable assignment
|
98
98
|
EndAlignment:
|
99
|
-
|
99
|
+
EnforcedStyleAlignWith: variable
|
100
100
|
|
101
101
|
# Prefer #kind_of? over #is_a?
|
102
102
|
ClassCheck:
|
@@ -110,6 +110,9 @@ UnneededPercentQ:
|
|
110
110
|
Metrics/AbcSize:
|
111
111
|
Max: 21.02
|
112
112
|
|
113
|
+
Metrics/BlockLength:
|
114
|
+
Enabled: false
|
115
|
+
|
113
116
|
# Do not prefer lambda.call(...) over lambda.(...)
|
114
117
|
LambdaCall:
|
115
118
|
Enabled: false
|
data/lib/mutant.rb
CHANGED
@@ -102,7 +102,7 @@ require 'mutant/mutator/node/literal/boolean'
|
|
102
102
|
require 'mutant/mutator/node/literal/range'
|
103
103
|
require 'mutant/mutator/node/literal/symbol'
|
104
104
|
require 'mutant/mutator/node/literal/string'
|
105
|
-
require 'mutant/mutator/node/literal/
|
105
|
+
require 'mutant/mutator/node/literal/integer'
|
106
106
|
require 'mutant/mutator/node/literal/float'
|
107
107
|
require 'mutant/mutator/node/literal/array'
|
108
108
|
require 'mutant/mutator/node/literal/hash'
|
@@ -31,6 +31,7 @@ module Mutant
|
|
31
31
|
[:regexp_backslash_escape, %i[escape backslash], ::Regexp::Expression::EscapeSequence::Literal],
|
32
32
|
[:regexp_tab_escape, %i[escape tab], ::Regexp::Expression::EscapeSequence::Literal],
|
33
33
|
[:regexp_codepoint_list_escape, %i[escape codepoint_list], ::Regexp::Expression::EscapeSequence::Literal],
|
34
|
+
[:regexp_codepoint_escape, %i[escape codepoint], ::Regexp::Expression::EscapeSequence::Literal],
|
34
35
|
[:regexp_control_escape, %i[escape control], ::Regexp::Expression::EscapeSequence::Control],
|
35
36
|
[:regexp_meta_sequence_escape, %i[escape meta_sequence], ::Regexp::Expression::EscapeSequence::Control]
|
36
37
|
)
|
data/lib/mutant/ast/types.rb
CHANGED
data/lib/mutant/diff.rb
CHANGED
data/lib/mutant/expression.rb
CHANGED
@@ -91,14 +91,14 @@ module Mutant
|
|
91
91
|
|
92
92
|
# Source file line
|
93
93
|
#
|
94
|
-
# @return [
|
94
|
+
# @return [Integer]
|
95
95
|
def source_line
|
96
96
|
source_location.last
|
97
97
|
end
|
98
98
|
|
99
99
|
# Full source location
|
100
100
|
#
|
101
|
-
# @return [Array{String,
|
101
|
+
# @return [Array{String,Integer}]
|
102
102
|
def source_location
|
103
103
|
target_method.source_location
|
104
104
|
end
|
data/lib/mutant/mutator/node.rb
CHANGED
@@ -14,7 +14,7 @@ module Mutant
|
|
14
14
|
#
|
15
15
|
# @param [Parser::AST::Node] node
|
16
16
|
#
|
17
|
-
# @param [
|
17
|
+
# @param [Integer] index
|
18
18
|
#
|
19
19
|
# @return [undefined]
|
20
20
|
def self.define_named_child(name, index)
|
@@ -51,7 +51,7 @@ module Mutant
|
|
51
51
|
|
52
52
|
# Dispatch on child index
|
53
53
|
#
|
54
|
-
# @param [
|
54
|
+
# @param [Integer] index
|
55
55
|
#
|
56
56
|
# @return [undefined]
|
57
57
|
def mutate_child(index, &block)
|
@@ -64,7 +64,7 @@ module Mutant
|
|
64
64
|
|
65
65
|
# Emit delete child mutation
|
66
66
|
#
|
67
|
-
# @param [
|
67
|
+
# @param [Integer] index
|
68
68
|
#
|
69
69
|
# @return [undefined]
|
70
70
|
def delete_child(index)
|
@@ -75,7 +75,7 @@ module Mutant
|
|
75
75
|
|
76
76
|
# Emit updated child
|
77
77
|
#
|
78
|
-
# @param [
|
78
|
+
# @param [Integer] index
|
79
79
|
# @param [Parser::AST::Node] node
|
80
80
|
#
|
81
81
|
# @return [undefined]
|
@@ -149,7 +149,7 @@ module Mutant
|
|
149
149
|
#
|
150
150
|
# @param [Range] range
|
151
151
|
#
|
152
|
-
# @return [Enumerable<
|
152
|
+
# @return [Enumerable<Integer>]
|
153
153
|
def children_indices(range)
|
154
154
|
range.begin.upto(children.length + range.end)
|
155
155
|
end
|
@@ -62,7 +62,7 @@ module Mutant
|
|
62
62
|
|
63
63
|
# Multiple left hand side childs
|
64
64
|
#
|
65
|
-
# @return [Enumerable<Parser::AST::Node,
|
65
|
+
# @return [Enumerable<Parser::AST::Node, Integer>]
|
66
66
|
def mlhs_childs_with_index
|
67
67
|
children.each_with_index.select do |child, _index|
|
68
68
|
n_mlhs?(child)
|
@@ -2,8 +2,8 @@ module Mutant
|
|
2
2
|
class Mutator
|
3
3
|
class Node
|
4
4
|
class Literal < self
|
5
|
-
# Mutator for
|
6
|
-
class
|
5
|
+
# Mutator for integer literals
|
6
|
+
class Integer < self
|
7
7
|
|
8
8
|
handle(:int)
|
9
9
|
|
@@ -28,10 +28,11 @@ module Mutant
|
|
28
28
|
#
|
29
29
|
# @return [Object]
|
30
30
|
def value
|
31
|
-
children
|
31
|
+
value, = children
|
32
|
+
value
|
32
33
|
end
|
33
34
|
|
34
|
-
end #
|
35
|
+
end # Integer
|
35
36
|
end # Literal
|
36
37
|
end # Node
|
37
38
|
end # Mutator
|
data/lib/mutant/repository.rb
CHANGED
data/lib/mutant/result.rb
CHANGED
@@ -94,14 +94,14 @@ module Mutant
|
|
94
94
|
|
95
95
|
# Amount of mutations
|
96
96
|
#
|
97
|
-
# @return [
|
97
|
+
# @return [Integer]
|
98
98
|
def amount_mutations
|
99
99
|
env.mutations.length
|
100
100
|
end
|
101
101
|
|
102
102
|
# Amount of subjects
|
103
103
|
#
|
104
|
-
# @return [
|
104
|
+
# @return [Integer]
|
105
105
|
def amount_subjects
|
106
106
|
env.subjects.length
|
107
107
|
end
|
@@ -146,28 +146,28 @@ module Mutant
|
|
146
146
|
|
147
147
|
# Amount of mutations
|
148
148
|
#
|
149
|
-
# @return [
|
149
|
+
# @return [Integer]
|
150
150
|
def amount_mutation_results
|
151
151
|
mutation_results.length
|
152
152
|
end
|
153
153
|
|
154
154
|
# Amount of mutations
|
155
155
|
#
|
156
|
-
# @return [
|
156
|
+
# @return [Integer]
|
157
157
|
def amount_mutations
|
158
158
|
subject.mutations.length
|
159
159
|
end
|
160
160
|
|
161
161
|
# Number of killed mutations
|
162
162
|
#
|
163
|
-
# @return [
|
163
|
+
# @return [Integer]
|
164
164
|
def amount_mutations_killed
|
165
165
|
killed_mutation_results.length
|
166
166
|
end
|
167
167
|
|
168
168
|
# Number of alive mutations
|
169
169
|
#
|
170
|
-
# @return [
|
170
|
+
# @return [Integer]
|
171
171
|
def amount_mutations_alive
|
172
172
|
alive_mutation_results.length
|
173
173
|
end
|
data/lib/mutant/subject.rb
CHANGED
@@ -33,7 +33,7 @@ module Mutant
|
|
33
33
|
|
34
34
|
# Source line range
|
35
35
|
#
|
36
|
-
# @return [Range<
|
36
|
+
# @return [Range<Integer>]
|
37
37
|
def source_lines
|
38
38
|
expression = node.location.expression
|
39
39
|
expression.line..expression.source_buffer.decompose_position(expression.end_pos).first
|
@@ -42,7 +42,7 @@ module Mutant
|
|
42
42
|
|
43
43
|
# First source line
|
44
44
|
#
|
45
|
-
# @return [
|
45
|
+
# @return [Integer]
|
46
46
|
def source_line
|
47
47
|
source_lines.begin
|
48
48
|
end
|
data/lib/mutant/version.rb
CHANGED
data/meta/case.rb
CHANGED
data/mutant.gemspec
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require File.expand_path('../lib/mutant/version', __FILE__)
|
2
2
|
|
3
|
-
# rubocop:disable Metrics/BlockLength
|
4
3
|
Gem::Specification.new do |gem|
|
5
4
|
gem.name = 'mutant'
|
6
5
|
gem.version = Mutant::VERSION.dup
|
@@ -22,9 +21,9 @@ Gem::Specification.new do |gem|
|
|
22
21
|
|
23
22
|
gem.required_ruby_version = '>= 2.1'
|
24
23
|
|
25
|
-
gem.add_runtime_dependency('parser', '
|
24
|
+
gem.add_runtime_dependency('parser', '>= 2.3.1.4', '< 2.5')
|
26
25
|
gem.add_runtime_dependency('ast', '~> 2.2')
|
27
|
-
gem.add_runtime_dependency('diff-lcs', '~> 1.
|
26
|
+
gem.add_runtime_dependency('diff-lcs', '~> 1.3')
|
28
27
|
gem.add_runtime_dependency('parallel', '~> 1.3')
|
29
28
|
gem.add_runtime_dependency('morpher', '~> 0.2.6')
|
30
29
|
gem.add_runtime_dependency('procto', '~> 0.0.2')
|
@@ -36,7 +35,7 @@ Gem::Specification.new do |gem|
|
|
36
35
|
gem.add_runtime_dependency('equalizer', '~> 0.0.9')
|
37
36
|
gem.add_runtime_dependency('anima', '~> 0.3.0')
|
38
37
|
gem.add_runtime_dependency('concord', '~> 0.1.5')
|
39
|
-
gem.add_runtime_dependency('regexp_parser', '~> 0.4.
|
38
|
+
gem.add_runtime_dependency('regexp_parser', '~> 0.4.3')
|
40
39
|
|
41
40
|
gem.add_development_dependency('devtools', '~> 0.1.12')
|
42
41
|
gem.add_development_dependency('bundler', '~> 1.10')
|
data/spec/integrations.yml
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
RSpec.shared_examples_for 'framework integration' do
|
2
|
+
def system_with_gemfile(*command)
|
3
|
+
Kernel.system({ 'BUNDLE_GEMFILE' => gemfile }, *command)
|
4
|
+
end
|
5
|
+
|
2
6
|
around do |example|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
ENV['BUNDLE_GEMFILE'] = gemfile
|
7
|
-
example.run
|
8
|
-
end
|
7
|
+
Dir.chdir(TestApp.root) do
|
8
|
+
Kernel.system('bundle', 'install', '--gemfile', gemfile) || fail('Bundle install failed!')
|
9
|
+
example.run
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
@@ -20,16 +21,16 @@ RSpec.shared_examples_for 'framework integration' do
|
|
20
21
|
TestApp::Literal#uncovered_string
|
21
22
|
--ignore-subject TestApp::Literal#uncovered_string
|
22
23
|
CMD
|
23
|
-
expect(
|
24
|
+
expect(system_with_gemfile(cli)).to be(true)
|
24
25
|
end
|
25
26
|
|
26
27
|
specify 'fails to kill mutations when they are not covered' do
|
27
28
|
cli = "#{base_cmd} TestApp::Literal#uncovered_string"
|
28
|
-
expect(
|
29
|
+
expect(system_with_gemfile(cli)).to be(false)
|
29
30
|
end
|
30
31
|
|
31
32
|
specify 'fails when some mutations are not covered' do
|
32
33
|
cli = "#{base_cmd} TestApp::Literal"
|
33
|
-
expect(
|
34
|
+
expect(system_with_gemfile(cli)).to be(false)
|
34
35
|
end
|
35
36
|
end
|
data/spec/support/corpus.rb
CHANGED
@@ -50,18 +50,16 @@ module MutantSpec
|
|
50
50
|
def verify_mutation_coverage
|
51
51
|
checkout
|
52
52
|
Dir.chdir(repo_path) do
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
)
|
64
|
-
end
|
53
|
+
install_mutant
|
54
|
+
system(
|
55
|
+
%W[
|
56
|
+
bundle exec mutant
|
57
|
+
--use rspec
|
58
|
+
--include lib
|
59
|
+
--require #{name}
|
60
|
+
#{namespace}*
|
61
|
+
]
|
62
|
+
)
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
@@ -123,7 +121,7 @@ module MutantSpec
|
|
123
121
|
#
|
124
122
|
# @param path [Pathname] path responsible for exception
|
125
123
|
#
|
126
|
-
# @return [
|
124
|
+
# @return [Integer] mutations generated
|
127
125
|
def count_mutations_and_check_errors(path)
|
128
126
|
relative_path = path.relative_path_from(repo_path)
|
129
127
|
|
@@ -144,7 +142,7 @@ module MutantSpec
|
|
144
142
|
#
|
145
143
|
# @raise [Exception] any error specified by integrations.yml
|
146
144
|
#
|
147
|
-
# @return [
|
145
|
+
# @return [Integer] number of mutations generated
|
148
146
|
def count_mutations(path)
|
149
147
|
node = Parser::CurrentRuby.parse(path.read)
|
150
148
|
|
@@ -181,7 +179,7 @@ module MutantSpec
|
|
181
179
|
|
182
180
|
# Number of parallel processes to use
|
183
181
|
#
|
184
|
-
# @return [
|
182
|
+
# @return [Integer]
|
185
183
|
def parallel_processes
|
186
184
|
if ENV.key?('CI')
|
187
185
|
CIRCLE_CI_CONTAINER_PROCESSES
|
@@ -207,7 +205,7 @@ module MutantSpec
|
|
207
205
|
# Print start progress
|
208
206
|
#
|
209
207
|
# @param [Pathname] path
|
210
|
-
# @param [
|
208
|
+
# @param [Integer] _index
|
211
209
|
#
|
212
210
|
# @return [undefined]
|
213
211
|
#
|
@@ -220,8 +218,8 @@ module MutantSpec
|
|
220
218
|
# Print finish progress
|
221
219
|
#
|
222
220
|
# @param [Pathname] path
|
223
|
-
# @param [
|
224
|
-
# @param [
|
221
|
+
# @param [Integer] _index
|
222
|
+
# @param [Integer] count
|
225
223
|
#
|
226
224
|
# @return [undefined]
|
227
225
|
#
|
data/spec/support/warning.rb
CHANGED
@@ -57,7 +57,7 @@ module MutantSpec
|
|
57
57
|
end
|
58
58
|
|
59
59
|
warnings = Pathname.new(__dir__).join('warnings.yml').freeze
|
60
|
-
whitelist = IceNine.deep_freeze(YAML.load(warnings.read))
|
60
|
+
whitelist = IceNine.deep_freeze(YAML.load(warnings.read)) # rubocop:disable Security/YAMLLoad
|
61
61
|
|
62
62
|
EXTRACTOR = Extractor.new(STDERR, whitelist)
|
63
63
|
end
|
data/spec/support/warnings.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
---
|
2
|
+
- 'lib/parallel.rb:222: warning: shadowing outer local variable - args'
|
3
|
+
- 'lib/parallel.rb:227: warning: shadowing outer local variable - args'
|
2
4
|
- 'lib/parser/lexer.rb:10922: warning: assigned but unused variable - testEof'
|
3
|
-
- 'lib/
|
4
|
-
- 'lib/regexp_parser/scanner.rb:1646: warning: assigned but unused variable - testEof'
|
5
|
+
- 'lib/regexp_parser/scanner.rb:1674: warning: assigned but unused variable - testEof'
|
@@ -14,7 +14,7 @@ RSpec.describe Mutant::Isolation::Fork do
|
|
14
14
|
let(:isolated_block) { -> { block_return } }
|
15
15
|
let(:marshal) { class_double(Marshal) }
|
16
16
|
let(:process) { class_double(Process) }
|
17
|
-
let(:pid) { class_double(
|
17
|
+
let(:pid) { class_double(0.class) }
|
18
18
|
let(:reader) { instance_double(IO, :reader) }
|
19
19
|
let(:stderr) { instance_double(IO, :stderr) }
|
20
20
|
let(:stdout) { instance_double(IO, :stdout) }
|
@@ -10,7 +10,7 @@ RSpec.describe Mutant::Loader, '.call' do
|
|
10
10
|
|
11
11
|
let(:path) { instance_double(Pathname, to_s: path_str) }
|
12
12
|
let(:path_str) { instance_double(String) }
|
13
|
-
let(:line) { instance_double(
|
13
|
+
let(:line) { instance_double(0.class) }
|
14
14
|
let(:kernel) { class_double(Kernel) }
|
15
15
|
let(:binding) { instance_double(Binding) }
|
16
16
|
let(:source) { instance_double(String) }
|
@@ -38,7 +38,7 @@ RSpec.describe Mutant::Parallel::Worker do
|
|
38
38
|
message_sequence.add(:worker, :stop)
|
39
39
|
end
|
40
40
|
|
41
|
-
let(:index) { instance_double(
|
41
|
+
let(:index) { instance_double(0.class) }
|
42
42
|
let(:job_result) { Mutant::Parallel::JobResult.new(job: job, payload: result_payload) }
|
43
43
|
let(:job) { Mutant::Parallel::Job.new(index: index, payload: payload) }
|
44
44
|
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06
|
11
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.3.1
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 2.3.1.4
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.5'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 2.3.1
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 2.3.1.4
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.5'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: ast
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '1.
|
53
|
+
version: '1.3'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '1.
|
60
|
+
version: '1.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: parallel
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,14 +218,14 @@ dependencies:
|
|
218
218
|
requirements:
|
219
219
|
- - "~>"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: 0.4.
|
221
|
+
version: 0.4.3
|
222
222
|
type: :runtime
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - "~>"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: 0.4.
|
228
|
+
version: 0.4.3
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: devtools
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -385,9 +385,9 @@ files:
|
|
385
385
|
- lib/mutant/mutator/node/literal.rb
|
386
386
|
- lib/mutant/mutator/node/literal/array.rb
|
387
387
|
- lib/mutant/mutator/node/literal/boolean.rb
|
388
|
-
- lib/mutant/mutator/node/literal/fixnum.rb
|
389
388
|
- lib/mutant/mutator/node/literal/float.rb
|
390
389
|
- lib/mutant/mutator/node/literal/hash.rb
|
390
|
+
- lib/mutant/mutator/node/literal/integer.rb
|
391
391
|
- lib/mutant/mutator/node/literal/nil.rb
|
392
392
|
- lib/mutant/mutator/node/literal/range.rb
|
393
393
|
- lib/mutant/mutator/node/literal/regex.rb
|