mutant 0.11.8 → 0.11.9

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: 8f0916d0fcbcaf139a30b5f323fa1c259c63527e4b2ef490f87bbf040a5a1462
4
- data.tar.gz: a24c306ae706361b4cd7ced9836d3e2124ef27b88ddc77f55f41b10a43b04056
3
+ metadata.gz: 6cfe7ef3344fe2802cd0004827386547ff6e67adadfd7117bb51d3dadb8ed53d
4
+ data.tar.gz: f8aae5c34fa4ec0c98245641ab1773a8fe0917c56c045c0859016febdaa9e4e3
5
5
  SHA512:
6
- metadata.gz: 344a97dca1c196102a2ff67e466a82eced65ca0f993f377bd732de46d93c67239704b86ffb352793a211a806c8c9ade8d7445521a166f33b10a2b2eced9cd993
7
- data.tar.gz: a7da63e824aa6153471b7ab1845748ff90acfc1247355df81147df3d92e23991b6d720374b375647bb1e10878c6112799f3493bccca40f91c9f3089ea112eb54
6
+ metadata.gz: a5c05d42faaeec2ef7e70defece4cbf35cfb5d726aefcbcc97b0ffce260851a20d2ce1815bcf0776b14d7eb1e5aef94fde299c220997f3a0d20e4acfb71b18eb
7
+ data.tar.gz: 2c102205b6d798214da493c263e21f587ad86354a4ff8a389ac091ec2bc212c63d563e8e5aec867c21d277e3a7881e1f3981df625324e3801eb5ff23fcf7dc20
@@ -19,7 +19,7 @@ module Mutant
19
19
  #
20
20
  # @return [Boolean]
21
21
  def used?
22
- !name.to_s.start_with?(UNDERSCORE)
22
+ !name.start_with?(UNDERSCORE)
23
23
  end
24
24
  end # Optarg
25
25
 
@@ -85,9 +85,9 @@ module Mutant
85
85
 
86
86
  MESSAGE = <<~'MESSAGE'
87
87
  Caught an exception while accessing a method with
88
- #instance_method that is part of #{public,privat,protected}_instance_methods.
88
+ #instance_method that is part of #{public,private,protected}_instance_methods.
89
89
 
90
- This is a bug in your ruby implementation its stdlib, libaries our your code.
90
+ This is a bug in your ruby implementation, its stdlib, your dependencies, or your code.
91
91
 
92
92
  Mutant will ignore this method:
93
93
 
@@ -24,7 +24,7 @@ module Mutant
24
24
  end
25
25
 
26
26
  def skip?
27
- name.to_s.start_with?(UNDERSCORE)
27
+ name.start_with?(UNDERSCORE)
28
28
  end
29
29
 
30
30
  # Mutator for optional arguments
@@ -16,6 +16,7 @@ module Mutant
16
16
  emit_argument_presence
17
17
  emit_argument_mutations
18
18
  emit_mlhs_expansion
19
+ emit_procarg0_removal
19
20
  end
20
21
 
21
22
  def emit_argument_presence
@@ -75,6 +76,13 @@ module Mutant
75
76
  end
76
77
  end
77
78
 
79
+ def emit_procarg0_removal
80
+ return unless children.one? && n_procarg0?((procarg0 = Mutant::Util.one(children)))
81
+
82
+ arguments = procarg0.children
83
+ emit_type(*arguments) if arguments.count > 1
84
+ end
85
+
78
86
  end # Arguments
79
87
  end # Node
80
88
  end # Mutator
@@ -26,7 +26,9 @@ module Mutant
26
26
 
27
27
  return unless body
28
28
  emit(body) unless body_has_control?
29
- emit_body_mutations
29
+ emit_body_mutations do |node|
30
+ !(n_nil?(node) && unconditional_loop?)
31
+ end
30
32
 
31
33
  mutate_body_receiver
32
34
  end
@@ -6,7 +6,7 @@ module Mutant
6
6
  # Mutator for dynamic literals
7
7
  class DynamicLiteral < self
8
8
 
9
- handle(:dstr, :dsym)
9
+ handle(:dstr, :dsym, :xstr)
10
10
 
11
11
  private
12
12
 
@@ -7,14 +7,10 @@ module Mutant
7
7
 
8
8
  handle :procarg0
9
9
 
10
- children :argument
11
-
12
10
  private
13
11
 
14
12
  def dispatch
15
- name = Mutant::Util.one(argument.children)
16
-
17
- emit_type(s(:arg, :"_#{name}")) unless name.to_s.start_with?('_')
13
+ children.each_index(&method(:mutate_child))
18
14
  end
19
15
  end # ProcargZero
20
16
  end # Node
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.11.8'
5
+ VERSION = '0.11.9'
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.8
4
+ version: 0.11.9
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-25 00:00:00.000000000 Z
11
+ date: 2022-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -386,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  - !ruby/object:Gem::Version
387
387
  version: '0'
388
388
  requirements: []
389
- rubygems_version: 3.2.33
389
+ rubygems_version: 3.1.6
390
390
  signing_key:
391
391
  specification_version: 4
392
392
  summary: ''