mutant 0.9.1 → 0.9.2
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/Gemfile +2 -0
- data/Gemfile.lock +17 -11
- data/lib/mutant/ast/types.rb +1 -4
- data/lib/mutant/mutator/node/arguments.rb +3 -10
- data/lib/mutant/mutator/node/generic.rb +4 -0
- data/lib/mutant/mutator/node/procarg_zero.rb +2 -16
- data/lib/mutant/version.rb +1 -1
- data/meta/block.rb +3 -5
- data/mutant.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b6a747b9980b4450831809ea2a799652f93dbd5be93ffe2a9ad25df314dddff
|
4
|
+
data.tar.gz: 2b72a0f6af97d24ab2191665e9be7d5975394348cc2b077d2f5efcb27fb38a89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f104307508a7c296b1b69f245394d0eef7f1991669a35b603aa8e4c21f5d9c205f509de519ae314e450c9cd57a879807d9b1778d84c822902fdafe9c68f8731a
|
7
|
+
data.tar.gz: a57dd99f21bfc48fa3a40f2fae04c8005f32c5615bc4509d30fafbc6f047c29a27b3eafa5f1de6329b9cb1b822a5fa72ee8ff8c8957b4bb45727204daa4ff56f
|
data/Changelog.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -21,10 +21,23 @@ GIT
|
|
21
21
|
yard (~> 0.9.16)
|
22
22
|
yardstick (~> 0.9.9)
|
23
23
|
|
24
|
+
GIT
|
25
|
+
remote: https://github.com/mbj/unparser.git
|
26
|
+
revision: 157a5b3b43e9f1d540da74b1751dc2b6f7601c3b
|
27
|
+
specs:
|
28
|
+
unparser (0.4.6)
|
29
|
+
abstract_type (~> 0.0.7)
|
30
|
+
adamantium (~> 0.2.0)
|
31
|
+
concord (~> 0.1.5)
|
32
|
+
diff-lcs (~> 1.3)
|
33
|
+
equalizer (~> 0.0.9)
|
34
|
+
parser (~> 2.6.5)
|
35
|
+
procto (~> 0.0.2)
|
36
|
+
|
24
37
|
PATH
|
25
38
|
remote: .
|
26
39
|
specs:
|
27
|
-
mutant (0.9.
|
40
|
+
mutant (0.9.1)
|
28
41
|
abstract_type (~> 0.0.7)
|
29
42
|
adamantium (~> 0.2.0)
|
30
43
|
anima (~> 0.3.1)
|
@@ -35,7 +48,7 @@ PATH
|
|
35
48
|
ice_nine (~> 0.11.1)
|
36
49
|
memoizable (~> 0.4.2)
|
37
50
|
mutant-license (~> 0.1.0)
|
38
|
-
parser (
|
51
|
+
parser (~> 2.6.5)
|
39
52
|
procto (~> 0.0.2)
|
40
53
|
unparser (~> 0.4.5)
|
41
54
|
|
@@ -86,7 +99,7 @@ GEM
|
|
86
99
|
thread_safe (~> 0.3, >= 0.3.1)
|
87
100
|
mutant-license (0.1.0)
|
88
101
|
parallel (1.19.1)
|
89
|
-
parser (2.6.
|
102
|
+
parser (2.6.5.0)
|
90
103
|
ast (~> 2.4.0)
|
91
104
|
path_expander (1.1.0)
|
92
105
|
powerpack (0.1.2)
|
@@ -135,14 +148,6 @@ GEM
|
|
135
148
|
simplecov-html (0.10.2)
|
136
149
|
thread_safe (0.3.6)
|
137
150
|
unicode-display_width (1.4.1)
|
138
|
-
unparser (0.4.5)
|
139
|
-
abstract_type (~> 0.0.7)
|
140
|
-
adamantium (~> 0.2.0)
|
141
|
-
concord (~> 0.1.5)
|
142
|
-
diff-lcs (~> 1.3)
|
143
|
-
equalizer (~> 0.0.9)
|
144
|
-
parser (~> 2.6.3)
|
145
|
-
procto (~> 0.0.2)
|
146
151
|
virtus (1.0.5)
|
147
152
|
axiom-types (~> 0.1)
|
148
153
|
coercible (~> 1.0)
|
@@ -160,6 +165,7 @@ DEPENDENCIES
|
|
160
165
|
mutant!
|
161
166
|
mutant-license!
|
162
167
|
parallel (~> 1.3)
|
168
|
+
unparser!
|
163
169
|
|
164
170
|
BUNDLED WITH
|
165
171
|
1.17.3
|
data/lib/mutant/ast/types.rb
CHANGED
@@ -66,11 +66,8 @@ module Mutant
|
|
66
66
|
# Nodes that are NOT generated by parser but used by mutant / unparser.
|
67
67
|
GENERATED = Set.new(%i[empty]).freeze
|
68
68
|
|
69
|
-
# Nodes missing from parser metadata
|
70
|
-
MISSING = Set.new(%i[index indexasgn lambda procarg0]).freeze
|
71
|
-
|
72
69
|
ALL = Set.new(
|
73
|
-
(Parser::Meta::NODE_TYPES + GENERATED
|
70
|
+
(Parser::Meta::NODE_TYPES + GENERATED) - BLACKLIST
|
74
71
|
).freeze
|
75
72
|
end # Types
|
76
73
|
end # AST
|
@@ -8,6 +8,8 @@ module Mutant
|
|
8
8
|
|
9
9
|
handle(:args)
|
10
10
|
|
11
|
+
PROCARG = %i[restarg mlhs].freeze
|
12
|
+
|
11
13
|
private
|
12
14
|
|
13
15
|
# Emit mutations
|
@@ -26,21 +28,12 @@ module Mutant
|
|
26
28
|
emit_type
|
27
29
|
|
28
30
|
Util::Array::Presence.call(children).each do |children|
|
29
|
-
|
30
|
-
emit_procarg(Mutant::Util.one(children))
|
31
|
-
else
|
31
|
+
unless children.one? && n_mlhs?(children.first)
|
32
32
|
emit_type(*children)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
# Emit procarg form
|
38
|
-
#
|
39
|
-
# @return [undefined]
|
40
|
-
def emit_procarg(arg)
|
41
|
-
emit_type(s(:procarg0, *arg))
|
42
|
-
end
|
43
|
-
|
44
37
|
# Emit argument mutations
|
45
38
|
#
|
46
39
|
# @return [undefined]
|
@@ -21,23 +21,9 @@ module Mutant
|
|
21
21
|
#
|
22
22
|
# @return [undefined]
|
23
23
|
def dispatch
|
24
|
-
|
25
|
-
end
|
24
|
+
name = Mutant::Util.one(argument.children)
|
26
25
|
|
27
|
-
|
28
|
-
#
|
29
|
-
# @return [undefined]
|
30
|
-
def emit_argument_symbol_mutations
|
31
|
-
emit_type(:"_#{argument}") unless argument.to_s.start_with?('_')
|
32
|
-
end
|
33
|
-
|
34
|
-
# Emit argument node mutations
|
35
|
-
#
|
36
|
-
# @return [undefined]
|
37
|
-
def emit_argument_node_mutations
|
38
|
-
emit_argument_mutations
|
39
|
-
first = Mutant::Util.one(argument.children)
|
40
|
-
emit_type(first)
|
26
|
+
emit_type(s(:arg, :"_#{name}")) unless name.to_s.start_with?('_')
|
41
27
|
end
|
42
28
|
end # ProcargZero
|
43
29
|
end # Node
|
data/lib/mutant/version.rb
CHANGED
data/meta/block.rb
CHANGED
@@ -38,7 +38,6 @@ Mutant::Meta::Example.add :block do
|
|
38
38
|
mutation 'foo { |(a, b), c| raise }'
|
39
39
|
mutation 'foo { |(a), c| }'
|
40
40
|
mutation 'foo { |(b), c| }'
|
41
|
-
mutation 'foo { |(a, b)| }'
|
42
41
|
mutation 'foo { |c, | }'
|
43
42
|
mutation 'foo { |(_a, b), c| }'
|
44
43
|
mutation 'foo { |(a, _b), c| }'
|
@@ -81,13 +80,12 @@ Mutant::Meta::Example.add :block do
|
|
81
80
|
end
|
82
81
|
|
83
82
|
Mutant::Meta::Example.add :block do
|
84
|
-
source 'foo { |
|
83
|
+
source 'foo { |a| }'
|
85
84
|
|
86
85
|
singleton_mutations
|
87
86
|
mutation 'foo { || }'
|
88
|
-
mutation 'foo { |a| }'
|
89
|
-
mutation 'foo { |
|
90
|
-
mutation 'foo { |(_a)| }'
|
87
|
+
mutation 'foo { |a| raise }'
|
88
|
+
mutation 'foo { |_a| }'
|
91
89
|
mutation 'foo'
|
92
90
|
end
|
93
91
|
|
data/mutant.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |gem|
|
|
31
31
|
gem.add_runtime_dependency('ice_nine', '~> 0.11.1')
|
32
32
|
gem.add_runtime_dependency('memoizable', '~> 0.4.2')
|
33
33
|
gem.add_runtime_dependency('mutant-license', '~> 0.1.0')
|
34
|
-
gem.add_runtime_dependency('parser', '
|
34
|
+
gem.add_runtime_dependency('parser', '~> 2.6.5')
|
35
35
|
gem.add_runtime_dependency('procto', '~> 0.0.2')
|
36
36
|
gem.add_runtime_dependency('unparser', '~> 0.4.5')
|
37
37
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: parser
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.6.
|
159
|
+
version: 2.6.5
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.6.
|
166
|
+
version: 2.6.5
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: procto
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|