mutant 0.10.22 → 0.10.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutant/mutator/node/kwargs.rb +12 -2
- data/lib/mutant/mutator/node/send.rb +5 -1
- data/lib/mutant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de1bb499dcb7be47ab3ffecf16968d48f17e34825a8cdb64f3a16aded7c76c35
|
4
|
+
data.tar.gz: eccbf7d336879f50a9f018b404ef64289d112f5cf377bccf38c7a6a73d28c7d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec30feb496c9f71dfef0766febd898508f41b252a2a5b678f98cc811947a50b8a57bbaee1eae40175b4593e9292ee858cf337d1ff5d3fb5e951ed93fc4117eb6
|
7
|
+
data.tar.gz: 98b4ec5a27cfef0a94d167d281fa7735c514b34bee7d0f9b677cc49a5a046146e1e06d467bffeed6a8f8b0467201727b6901bffcfa4d48d57a6d43f2016ed15a
|
@@ -6,6 +6,10 @@ module Mutant
|
|
6
6
|
# Mutator for kwargs node
|
7
7
|
class Kwargs < self
|
8
8
|
|
9
|
+
DISALLOW = %i[nil self].freeze
|
10
|
+
|
11
|
+
private_constant(*constants(false))
|
12
|
+
|
9
13
|
handle(:kwargs)
|
10
14
|
|
11
15
|
private
|
@@ -17,17 +21,23 @@ module Mutant
|
|
17
21
|
|
18
22
|
def emit_argument_presence
|
19
23
|
Util::Array::Presence.call(children).each do |children|
|
20
|
-
emit_type(*children)
|
24
|
+
emit_type(*children) unless children.empty?
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
def emit_argument_mutations
|
25
29
|
children.each_with_index do |child, index|
|
26
30
|
Mutator.mutate(child).each do |mutant|
|
27
|
-
|
31
|
+
if forbid_argument?(mutant)
|
32
|
+
emit_child_update(index, mutant)
|
33
|
+
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
37
|
+
|
38
|
+
def forbid_argument?(node)
|
39
|
+
!(n_pair?(node) && DISALLOW.include?(node.children.first.type))
|
40
|
+
end
|
31
41
|
end # Kwargs
|
32
42
|
end # Node
|
33
43
|
end # Mutator
|
@@ -177,7 +177,11 @@ module Mutant
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def emit_argument_propagation
|
180
|
-
|
180
|
+
return unless arguments.one?
|
181
|
+
|
182
|
+
argument = Mutant::Util.one(arguments)
|
183
|
+
|
184
|
+
emit_propagation(argument) unless n_kwargs?(argument)
|
181
185
|
end
|
182
186
|
|
183
187
|
def mutate_receiver
|
data/lib/mutant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: abstract_type
|
@@ -474,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
474
474
|
- !ruby/object:Gem::Version
|
475
475
|
version: '0'
|
476
476
|
requirements: []
|
477
|
-
rubygems_version: 3.0.
|
477
|
+
rubygems_version: 3.2.0.rc.1
|
478
478
|
signing_key:
|
479
479
|
specification_version: 4
|
480
480
|
summary: ''
|