mutant 0.10.21 → 0.10.22

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: ace60aadd53eaa9d10a47ad5bfd16cc0bd825be0588356fdfacc8e00ee767c20
4
- data.tar.gz: 89f5a6460423c7ae12a735f55df13aa8e0077e76243a6fb0bf09d31babafc774
3
+ metadata.gz: e1672efb6d075c7efa99f9f45efad0e6362f082eda55943540ab02c7a8a6dbf9
4
+ data.tar.gz: cb419c57b1f7e2955c7b80bc3c59d604d197f3bf58732da72a8442e3023a4b9e
5
5
  SHA512:
6
- metadata.gz: 3dd24a1870b332e38dd4e40041d6ce60f1fe23bdf26490ace7bb8f5a285f927880a1898cf6e85d04055723aca9043fa382b19bc86ad29565bafd7a51258b1727
7
- data.tar.gz: a855387e41f516caf8759eba4e0c0fe10f144dd4d5e9241bf3f41a768d3fde8bcee0ae70ff3b1ddaeeaf97aa8cd38301832c6b963d0c5eff8d245dc721638594
6
+ metadata.gz: 016d92ae5cf2c2fc6c253cd7078583db2b9bee2ff01b14517f3ea12ded8a35e4cfe5df2647aa8d809144ab10c3d0d9bf56c66c1aaeeb1ee53c1e3facbcbca493
7
+ data.tar.gz: 8727a5a0520174b5c27464316eaff0130546ccabbc4dde3a0c45ca452ed0efdc46e3bccd2e52eaf01cc3fd5aacb041f3ef28783e98259d993a1f1a419a70b9eb
@@ -130,6 +130,7 @@ require 'mutant/mutator/node/rescue'
130
130
  require 'mutant/mutator/node/match_current_line'
131
131
  require 'mutant/mutator/node/index'
132
132
  require 'mutant/mutator/node/procarg_zero'
133
+ require 'mutant/mutator/node/kwargs'
133
134
  require 'mutant/loader'
134
135
  require 'mutant/context'
135
136
  require 'mutant/scope'
@@ -17,7 +17,7 @@ module Mutant
17
17
  def initialize(*)
18
18
  super
19
19
 
20
- @syntax = "#{scope_name}*"
20
+ @syntax = "#{scope_name}*".freeze # rubocop:disable Style/RedundantFreeze
21
21
 
22
22
  @recursion_pattern = Regexp.union(
23
23
  /\A#{scope_name}\z/,
@@ -21,7 +21,7 @@ module Mutant
21
21
  end
22
22
 
23
23
  def mutate_body
24
- emit_body(nil)
24
+ emit_body(nil) unless unconditional_loop?
25
25
  emit_body(N_RAISE)
26
26
 
27
27
  return unless body
@@ -31,6 +31,10 @@ module Mutant
31
31
  mutate_body_receiver
32
32
  end
33
33
 
34
+ def unconditional_loop?
35
+ send.eql?(s(:send, nil, :loop))
36
+ end
37
+
34
38
  def body_has_control?
35
39
  AST.find_last_path(body) do |node|
36
40
  n_break?(node) || n_next?(node)
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mutant
4
+ class Mutator
5
+ class Node
6
+ # Mutator for kwargs node
7
+ class Kwargs < self
8
+
9
+ handle(:kwargs)
10
+
11
+ private
12
+
13
+ def dispatch
14
+ emit_argument_presence
15
+ emit_argument_mutations
16
+ end
17
+
18
+ def emit_argument_presence
19
+ Util::Array::Presence.call(children).each do |children|
20
+ emit_type(*children)
21
+ end
22
+ end
23
+
24
+ def emit_argument_mutations
25
+ children.each_with_index do |child, index|
26
+ Mutator.mutate(child).each do |mutant|
27
+ emit_child_update(index, mutant)
28
+ end
29
+ end
30
+ end
31
+ end # Kwargs
32
+ end # Node
33
+ end # Mutator
34
+ end # Mutant
@@ -52,7 +52,7 @@ module Mutant
52
52
  # rubocop:disable Style/GuardClause
53
53
  if FREEZER_OPTION_VALUES.key?(freezer)
54
54
  [
55
- s(:hash,
55
+ s(:kwargs,
56
56
  s(:pair,
57
57
  s(:sym, :freezer),
58
58
  s(:sym, FREEZER_OPTION_VALUES.fetch(freezer))))
@@ -14,8 +14,8 @@ module Mutant
14
14
  class Deadline
15
15
  include Anima.new(:timer, :allowed_time)
16
16
 
17
- def initialize(**arguments)
18
- super(**arguments)
17
+ def initialize(*arguments)
18
+ super(*arguments)
19
19
  @start_at = timer.now
20
20
  end
21
21
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.10.21'
5
+ VERSION = '0.10.22'
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.21
4
+ version: 0.10.22
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-23 00:00:00.000000000 Z
11
+ date: 2020-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 2.7.1
159
+ version: 3.0.0
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.7.1
166
+ version: 3.0.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: procto
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.5.4
187
+ version: 0.5.6
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.5.4
194
+ version: 0.5.6
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: variable
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -268,14 +268,14 @@ dependencies:
268
268
  requirements:
269
269
  - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: '1.2'
271
+ version: '1.7'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: '1.2'
278
+ version: '1.7'
279
279
  description: Mutation Testing for Ruby.
280
280
  email:
281
281
  - mbj@schirp-dso.com
@@ -366,6 +366,7 @@ files:
366
366
  - lib/mutant/mutator/node/generic.rb
367
367
  - lib/mutant/mutator/node/if.rb
368
368
  - lib/mutant/mutator/node/index.rb
369
+ - lib/mutant/mutator/node/kwargs.rb
369
370
  - lib/mutant/mutator/node/kwbegin.rb
370
371
  - lib/mutant/mutator/node/literal.rb
371
372
  - lib/mutant/mutator/node/literal/array.rb
@@ -473,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
474
  - !ruby/object:Gem::Version
474
475
  version: '0'
475
476
  requirements: []
476
- rubygems_version: 3.1.4
477
+ rubygems_version: 3.0.3
477
478
  signing_key:
478
479
  specification_version: 4
479
480
  summary: ''