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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1672efb6d075c7efa99f9f45efad0e6362f082eda55943540ab02c7a8a6dbf9
4
- data.tar.gz: cb419c57b1f7e2955c7b80bc3c59d604d197f3bf58732da72a8442e3023a4b9e
3
+ metadata.gz: de1bb499dcb7be47ab3ffecf16968d48f17e34825a8cdb64f3a16aded7c76c35
4
+ data.tar.gz: eccbf7d336879f50a9f018b404ef64289d112f5cf377bccf38c7a6a73d28c7d7
5
5
  SHA512:
6
- metadata.gz: 016d92ae5cf2c2fc6c253cd7078583db2b9bee2ff01b14517f3ea12ded8a35e4cfe5df2647aa8d809144ab10c3d0d9bf56c66c1aaeeb1ee53c1e3facbcbca493
7
- data.tar.gz: 8727a5a0520174b5c27464316eaff0130546ccabbc4dde3a0c45ca452ed0efdc46e3bccd2e52eaf01cc3fd5aacb041f3ef28783e98259d993a1f1a419a70b9eb
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
- emit_child_update(index, mutant)
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
- emit_propagation(Mutant::Util.one(arguments)) if arguments.one?
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.10.22'
5
+ VERSION = '0.10.23'
6
6
  end # Mutant
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.22
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-26 00:00:00.000000000 Z
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.3
477
+ rubygems_version: 3.2.0.rc.1
478
478
  signing_key:
479
479
  specification_version: 4
480
480
  summary: ''