mutant 0.10.27 → 0.10.28
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: def7afa7fdfc14c0010d8574451d48ae79a782527f80658d0f7eb1fc6c4fd5ec
|
4
|
+
data.tar.gz: b64e44cbce5459ef83bf008857c6aefd7b999dd3aaf4b4596779ed04defe79d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57830a2931c63d11d625b2543d96db985205478c5ce3282fdbbfa5ae4ba647705e1fe7617b0f2d3d08bbc9bb0f58507ff794f3137d83f4f1cd04faa9bf75ffcc
|
7
|
+
data.tar.gz: ff30915a342d8cfb20b192dc36e722cd5f9a601359bd045677df03be92d711476cf1ab105ff588df64adac757ac29a7d87a55b3c5943cc2af31324651e6c7cfd
|
@@ -8,9 +8,6 @@ module Mutant
|
|
8
8
|
Adamantium,
|
9
9
|
Concord::Public.new(:scope, :target_method, :evaluator)
|
10
10
|
|
11
|
-
# Source locations we cannot acces
|
12
|
-
BLACKLIST = %w[(eval) <internal:prelude>].to_set.freeze
|
13
|
-
|
14
11
|
SOURCE_LOCATION_WARNING_FORMAT =
|
15
12
|
'%s does not have a valid source location, unable to emit subject'
|
16
13
|
|
@@ -53,7 +50,10 @@ module Mutant
|
|
53
50
|
|
54
51
|
def skip?
|
55
52
|
location = source_location
|
56
|
-
|
53
|
+
|
54
|
+
file = location&.first
|
55
|
+
|
56
|
+
if location.nil? || !file.end_with?('.rb')
|
57
57
|
env.warn(SOURCE_LOCATION_WARNING_FORMAT % target_method)
|
58
58
|
elsif matched_node_path.any?(&method(:n_block?))
|
59
59
|
env.warn(CLOSURE_WARNING_FORMAT % target_method)
|
@@ -9,6 +9,8 @@ module Mutant
|
|
9
9
|
|
10
10
|
handle(:int)
|
11
11
|
|
12
|
+
children :value
|
13
|
+
|
12
14
|
private
|
13
15
|
|
14
16
|
def dispatch
|
@@ -17,12 +19,7 @@ module Mutant
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def values
|
20
|
-
[0, 1,
|
21
|
-
end
|
22
|
-
|
23
|
-
def value
|
24
|
-
value, = children
|
25
|
-
value
|
22
|
+
[0, 1, value + 1, value - 1]
|
26
23
|
end
|
27
24
|
|
28
25
|
end # Integer
|
@@ -87,6 +87,7 @@ module Mutant
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def emit_selector_specific_mutations
|
90
|
+
emit_reduce_to_sum_mutation
|
90
91
|
emit_start_end_with_mutations
|
91
92
|
emit_predicate_mutations
|
92
93
|
emit_array_mutation
|
@@ -98,6 +99,21 @@ module Mutant
|
|
98
99
|
emit_lambda_mutation
|
99
100
|
end
|
100
101
|
|
102
|
+
def emit_reduce_to_sum_mutation
|
103
|
+
return unless selector.equal?(:reduce)
|
104
|
+
|
105
|
+
reducer = arguments.last
|
106
|
+
|
107
|
+
return unless reducer.eql?(s(:sym, :+)) || reducer.eql?(s(:block_pass, s(:sym, :+)))
|
108
|
+
|
109
|
+
if arguments.length > 1
|
110
|
+
initial_value = arguments.first
|
111
|
+
emit_type(receiver, :sum, initial_value)
|
112
|
+
else
|
113
|
+
emit_type(receiver, :sum)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
101
117
|
def emit_start_end_with_mutations # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
|
102
118
|
return unless REGEXP_MATCH_METHODS.include?(selector) && arguments.one?
|
103
119
|
|
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.10.
|
4
|
+
version: 0.10.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|