mutant 0.11.3 → 0.11.4

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: 4fd616c16c6eb981572f300d63760de29c418e0c8c72b29b0462565aeec59271
4
- data.tar.gz: cff1c3128b75347267692919f598642dc6906faff02253b8bb5cf0a738b7488e
3
+ metadata.gz: 70a7ce19bef24f9e278efb7beee74d9ae0eed625f0e4e4a712d9330ac1907339
4
+ data.tar.gz: 814ca08aed382018685010ca642903ea1e4da3226ae4c7c0fb0fae920818be49
5
5
  SHA512:
6
- metadata.gz: 0a1fe601d15da1235e4384c15346f3080021b8f08dfdd2313f60882f722d45bc824d8099fd13cebe77ea97edd06ecba0bbd2ff64ede9b7f5765e2115652f4202
7
- data.tar.gz: b61a27b8b5119e489908bb43aa4aec0a348e552b443fa3b937ed20718f436e77740b0b891fc731fd1126eb5170525ffa7388d4ab555f9a7ef7e33812141b4ec7
6
+ metadata.gz: 3461d1141fdb8ec16d4262aaf9542ec9db4fc00bc31adf97024803ebd71133de3738c55dd08000f080ae59c8a29a6877eb9758001ea42ff54637a7b09d91e1ac
7
+ data.tar.gz: e03447c1d1d192fa98641fbee718ef3e6440b69a43d88023741635e348df94fe336cd92e716a1d8a9e638fba230530377a98ea413890f97b6654c0e45e88960e
@@ -93,7 +93,9 @@ module Mutant
93
93
 
94
94
  Object: %<scope>s
95
95
  Method: %<method_name>s
96
- Exception: %<exception>s
96
+ Exception:
97
+
98
+ %<exception>s
97
99
 
98
100
  See: https://github.com/mbj/mutant/issues/1273
99
101
  MESSAGE
@@ -6,6 +6,8 @@ module Mutant
6
6
  # Mutator for arguments node
7
7
  class Arguments < self
8
8
 
9
+ ANONYMOUS_BLOCKARG_PRED = ::Parser::AST::Node.new(:blockarg, [nil]).method(:eql?)
10
+
9
11
  handle(:args)
10
12
 
11
13
  private
@@ -17,15 +19,24 @@ module Mutant
17
19
  end
18
20
 
19
21
  def emit_argument_presence
20
- emit_type
22
+ emit_type unless removed_block_arg?(EMPTY_ARRAY)
21
23
 
22
24
  Util::Array::Presence.call(children).each do |children|
23
- unless children.one? && n_mlhs?(children.first)
25
+ unless removed_block_arg?(children) || (children.one? && n_mlhs?(children.first))
24
26
  emit_type(*children)
25
27
  end
26
28
  end
27
29
  end
28
30
 
31
+ def removed_block_arg?(children)
32
+ anonymous_block_arg? && children.none?(&ANONYMOUS_BLOCKARG_PRED)
33
+ end
34
+
35
+ def anonymous_block_arg?
36
+ children.any?(&ANONYMOUS_BLOCKARG_PRED)
37
+ end
38
+ memoize :anonymous_block_arg?
39
+
29
40
  def emit_argument_mutations
30
41
  children.each_with_index do |child, index|
31
42
  Mutator.mutate(child).each do |mutant|
@@ -12,6 +12,7 @@ module Mutant
12
12
  private
13
13
 
14
14
  def dispatch
15
+ return unless argument
15
16
  emit_argument_mutations
16
17
  emit_symbol_to_proc_mutations
17
18
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.11.3'
5
+ VERSION = '0.11.4'
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.3
4
+ version: 0.11.4
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-02-13 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs