mutant 0.11.5 → 0.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutant/mutation.rb +1 -1
- data/lib/mutant/mutator/node/arguments.rb +17 -7
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +1 -1
- data/lib/mutant/mutator/node/send.rb +3 -1
- data/lib/mutant/mutator/node/when.rb +1 -1
- data/lib/mutant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 945d6584e161b704f52d2f1efc3b6a78df03cc0f6b48d52f157bf47720623725
|
4
|
+
data.tar.gz: 7a507de1188d5d8a89740730d827c89f818dee72b844f3bccfa97264d1c1e266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37bb36a48e29385936390ebd92790051871b6ee9b5fe053c1249815ab4432db1dbe7633e236d5bf40c04a488c1f0288bca9e29b8282f7c8a4bd2bfe0da5ee15
|
7
|
+
data.tar.gz: 281fc2061663198b9676c1000793104c7bb52fed3f4892b02419bd7a7aaf2a7168f23fb1c7ba0653710900cd7bf2637de99998da37b87cac1ca021a2dd10b0d8
|
data/lib/mutant/mutation.rb
CHANGED
@@ -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
|
-
|
25
|
-
|
26
|
-
|
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
|
32
|
-
|
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[
|
60
|
+
n_arg?(mutant) && children[...index].any?(&method(:n_optarg?))
|
51
61
|
end
|
52
62
|
|
53
63
|
def emit_mlhs_expansion
|
@@ -241,7 +241,9 @@ module Mutant
|
|
241
241
|
|
242
242
|
argument = Mutant::Util.one(arguments)
|
243
243
|
|
244
|
-
|
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
|
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.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-
|
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.
|
388
|
+
rubygems_version: 3.3.3
|
389
389
|
signing_key:
|
390
390
|
specification_version: 4
|
391
391
|
summary: ''
|