mutant 0.11.5 → 0.11.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 162764a3b1bf798bc41ada84a438c93ff262c1e470bd03ca4577667577f3d12d
4
- data.tar.gz: 8949ae97fb1af8e30393518cac0c2affd0b962539c048db30ce61ab34ba6ad4c
3
+ metadata.gz: 945d6584e161b704f52d2f1efc3b6a78df03cc0f6b48d52f157bf47720623725
4
+ data.tar.gz: 7a507de1188d5d8a89740730d827c89f818dee72b844f3bccfa97264d1c1e266
5
5
  SHA512:
6
- metadata.gz: 8328c5f209244d2cee86828cc9923ddf649ccc7fa2ffd921b484468c77b8d8cf0c23ad58605286c25b9a58f98c92a8212eec2641cb00ead46dfaba92aef865f3
7
- data.tar.gz: 415018adeaea5c01d3ecbda5a8896e66de1facb819336093859cb5dc1b45d70e99e01bae63b355930dfffa22ad9bb23092aee97b14fff0fbe188b817a52783d6
6
+ metadata.gz: f37bb36a48e29385936390ebd92790051871b6ee9b5fe053c1249815ab4432db1dbe7633e236d5bf40c04a488c1f0288bca9e29b8282f7c8a4bd2bfe0da5ee15
7
+ data.tar.gz: 281fc2061663198b9676c1000793104c7bb52fed3f4892b02419bd7a7aaf2a7168f23fb1c7ba0653710900cd7bf2637de99998da37b87cac1ca021a2dd10b0d8
@@ -7,7 +7,7 @@ module Mutant
7
7
  include Concord::Public.new(:subject, :node)
8
8
 
9
9
  CODE_DELIMITER = "\0"
10
- CODE_RANGE = (0..4).freeze
10
+ CODE_RANGE = (..4).freeze
11
11
 
12
12
  # Mutation identification code
13
13
  #
@@ -19,17 +19,27 @@ module Mutant
19
19
  end
20
20
 
21
21
  def emit_argument_presence
22
- emit_type unless removed_block_arg?(EMPTY_ARRAY)
22
+ emit_type unless removed_block_arg?(EMPTY_ARRAY) || forward_arg?
23
23
 
24
- Util::Array::Presence.call(children).each do |children|
25
- unless removed_block_arg?(children) || (children.one? && n_mlhs?(children.first))
26
- emit_type(*children)
24
+ children.each_with_index do |removed, index|
25
+ new_arguments = children.dup
26
+ new_arguments.delete_at(index)
27
+ unless n_forward_arg?(removed) || removed_block_arg?(new_arguments) || only_mlhs?(new_arguments)
28
+ emit_type(*new_arguments)
27
29
  end
28
30
  end
29
31
  end
30
32
 
31
- def removed_block_arg?(children)
32
- anonymous_block_arg? && children.none?(&ANONYMOUS_BLOCKARG_PRED)
33
+ def only_mlhs?(new_arguments)
34
+ new_arguments.one? && n_mlhs?(new_arguments.first)
35
+ end
36
+
37
+ def forward_arg?
38
+ children.last && n_forward_arg?(children.last)
39
+ end
40
+
41
+ def removed_block_arg?(new_arguments)
42
+ anonymous_block_arg? && new_arguments.none?(&ANONYMOUS_BLOCKARG_PRED)
33
43
  end
34
44
 
35
45
  def anonymous_block_arg?
@@ -47,7 +57,7 @@ module Mutant
47
57
  end
48
58
 
49
59
  def invalid_argument_replacement?(mutant, index)
50
- n_arg?(mutant) && children[0...index].any?(&method(:n_optarg?))
60
+ n_arg?(mutant) && children[...index].any?(&method(:n_optarg?))
51
61
  end
52
62
 
53
63
  def emit_mlhs_expansion
@@ -7,7 +7,7 @@ module Mutant
7
7
  # Mutator for attribute assignments
8
8
  class AttributeAssignment < self
9
9
 
10
- ATTRIBUTE_RANGE = (0..-2).freeze
10
+ ATTRIBUTE_RANGE = (..-2).freeze
11
11
 
12
12
  private_constant(*constants(false))
13
13
 
@@ -241,7 +241,9 @@ module Mutant
241
241
 
242
242
  argument = Mutant::Util.one(arguments)
243
243
 
244
- emit_propagation(argument) unless n_kwargs?(argument)
244
+ return if n_kwargs?(argument) || n_forwarded_args?(argument)
245
+
246
+ emit_propagation(argument)
245
247
  end
246
248
 
247
249
  def mutate_receiver
@@ -22,7 +22,7 @@ module Mutant
22
22
 
23
23
  def mutate_conditions
24
24
  conditions = children.length - 1
25
- children[0..-2].each_index do |index|
25
+ children[..-2].each_index do |index|
26
26
  delete_child(index) if conditions > 1
27
27
  mutate_child(index)
28
28
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.11.5'
5
+ VERSION = '0.11.6'
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.11.5
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-03 00:00:00.000000000 Z
11
+ date: 2022-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -385,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0'
387
387
  requirements: []
388
- rubygems_version: 3.1.6
388
+ rubygems_version: 3.3.3
389
389
  signing_key:
390
390
  specification_version: 4
391
391
  summary: ''