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 +4 -4
- data/lib/mutant/matcher/methods.rb +3 -1
- data/lib/mutant/mutator/node/arguments.rb +13 -2
- data/lib/mutant/mutator/node/block_pass.rb +1 -0
- data/lib/mutant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a7ce19bef24f9e278efb7beee74d9ae0eed625f0e4e4a712d9330ac1907339
|
4
|
+
data.tar.gz: 814ca08aed382018685010ca642903ea1e4da3226ae4c7c0fb0fae920818be49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3461d1141fdb8ec16d4262aaf9542ec9db4fc00bc31adf97024803ebd71133de3738c55dd08000f080ae59c8a29a6877eb9758001ea42ff54637a7b09d91e1ac
|
7
|
+
data.tar.gz: e03447c1d1d192fa98641fbee718ef3e6440b69a43d88023741635e348df94fe336cd92e716a1d8a9e638fba230530377a98ea413890f97b6654c0e45e88960e
|
@@ -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|
|
data/lib/mutant/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|