mutant 0.12.2 → 0.12.3
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 +4 -4
- data/lib/mutant/ast/named_children.rb +2 -2
- data/lib/mutant/ast/pattern/lexer.rb +6 -6
- data/lib/mutant/ast/pattern/parser.rb +9 -9
- data/lib/mutant/ast/structure.rb +1 -1
- data/lib/mutant/ast.rb +1 -1
- data/lib/mutant/bootstrap.rb +12 -12
- data/lib/mutant/cli/command/environment/test.rb +2 -2
- data/lib/mutant/cli/command/environment.rb +8 -8
- data/lib/mutant/cli/command/util.rb +2 -2
- data/lib/mutant/cli/command.rb +8 -8
- data/lib/mutant/cli.rb +1 -1
- data/lib/mutant/config.rb +2 -2
- data/lib/mutant/env.rb +10 -10
- data/lib/mutant/expression/descendants.rb +1 -1
- data/lib/mutant/expression/method.rb +2 -2
- data/lib/mutant/expression/methods.rb +2 -2
- data/lib/mutant/expression/source.rb +3 -3
- data/lib/mutant/integration.rb +2 -2
- data/lib/mutant/isolation/fork.rb +4 -4
- data/lib/mutant/isolation/none.rb +2 -2
- data/lib/mutant/matcher/descendants.rb +1 -1
- data/lib/mutant/matcher/method/instance.rb +3 -3
- data/lib/mutant/matcher/method/metaclass.rb +2 -2
- data/lib/mutant/matcher/method/singleton.rb +1 -1
- data/lib/mutant/matcher/method.rb +5 -19
- data/lib/mutant/matcher/methods.rb +2 -2
- data/lib/mutant/matcher/namespace.rb +1 -1
- data/lib/mutant/matcher/scope.rb +1 -1
- data/lib/mutant/matcher.rb +1 -1
- data/lib/mutant/meta/example/verification.rb +1 -1
- data/lib/mutant/meta/example.rb +4 -4
- data/lib/mutant/meta.rb +1 -1
- data/lib/mutant/mutation/runner/sink.rb +3 -3
- data/lib/mutant/mutation/runner.rb +1 -1
- data/lib/mutant/mutation.rb +2 -2
- data/lib/mutant/mutator/node/block.rb +1 -1
- data/lib/mutant/mutator/node/break.rb +1 -1
- data/lib/mutant/mutator/node/index.rb +1 -1
- data/lib/mutant/mutator/node/kwbegin.rb +1 -1
- data/lib/mutant/mutator/node/named_value/access.rb +1 -1
- data/lib/mutant/mutator/node/next.rb +1 -1
- data/lib/mutant/mutator/node/send/conditional.rb +1 -1
- data/lib/mutant/mutator/node/send.rb +1 -1
- data/lib/mutant/mutator/node/yield.rb +1 -1
- data/lib/mutant/mutator/node/zsuper.rb +0 -1
- data/lib/mutant/mutator/node.rb +5 -5
- data/lib/mutant/mutator/regexp.rb +2 -2
- data/lib/mutant/parallel/connection.rb +2 -2
- data/lib/mutant/parallel/pipe.rb +2 -2
- data/lib/mutant/parallel/worker.rb +10 -10
- data/lib/mutant/parallel.rb +3 -3
- data/lib/mutant/parser.rb +1 -1
- data/lib/mutant/registry.rb +1 -1
- data/lib/mutant/reporter/cli/format.rb +1 -1
- data/lib/mutant/reporter/cli/printer/isolation_result.rb +2 -2
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +1 -1
- data/lib/mutant/reporter/cli/printer/test.rb +1 -1
- data/lib/mutant/reporter/cli/printer.rb +1 -1
- data/lib/mutant/reporter/cli.rb +3 -3
- data/lib/mutant/repository/diff.rb +6 -5
- data/lib/mutant/segment/recorder.rb +8 -8
- data/lib/mutant/subject/config.rb +1 -1
- data/lib/mutant/subject/method/instance.rb +1 -1
- data/lib/mutant/subject.rb +1 -1
- data/lib/mutant/test/runner/sink.rb +1 -1
- data/lib/mutant/test/runner.rb +1 -1
- data/lib/mutant/timer.rb +2 -2
- data/lib/mutant/transform.rb +20 -20
- data/lib/mutant/variable.rb +2 -2
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/world.rb +7 -7
- data/lib/mutant.rb +8 -8
- metadata +6 -6
data/lib/mutant/subject.rb
CHANGED
data/lib/mutant/test/runner.rb
CHANGED
@@ -45,7 +45,7 @@ module Mutant
|
|
45
45
|
jobs: env.config.jobs,
|
46
46
|
on_process_start: env.method(:emit_test_worker_process_start),
|
47
47
|
process_name: 'mutant-test-runner-process',
|
48
|
-
sink: Sink.new(env:
|
48
|
+
sink: Sink.new(env:),
|
49
49
|
source: Parallel::Source::Array.new(jobs: env.integration.all_tests.each_index.to_a),
|
50
50
|
thread_name: 'mutant-test-runner-thread',
|
51
51
|
timeout: nil
|
data/lib/mutant/timer.rb
CHANGED
@@ -24,7 +24,7 @@ module Mutant
|
|
24
24
|
include Anima.new(:timer, :allowed_time)
|
25
25
|
|
26
26
|
def initialize(*arguments)
|
27
|
-
super
|
27
|
+
super
|
28
28
|
@start_at = timer.now
|
29
29
|
end
|
30
30
|
|
@@ -49,7 +49,7 @@ module Mutant
|
|
49
49
|
#
|
50
50
|
# @return [Status]
|
51
51
|
def status
|
52
|
-
Status.new(time_left:
|
52
|
+
Status.new(time_left:)
|
53
53
|
end
|
54
54
|
|
55
55
|
# Probe the time left
|
data/lib/mutant/transform.rb
CHANGED
@@ -35,7 +35,7 @@ module Mutant
|
|
35
35
|
#
|
36
36
|
# @return [String]
|
37
37
|
def compact_message
|
38
|
-
COMPACT % { path
|
38
|
+
COMPACT % { path:, message: trace.last.message }
|
39
39
|
end
|
40
40
|
memoize :compact_message
|
41
41
|
|
@@ -77,7 +77,7 @@ module Mutant
|
|
77
77
|
include Anima.new(:block, :name)
|
78
78
|
|
79
79
|
def self.capture(name, &block)
|
80
|
-
new(block
|
80
|
+
new(block:, name:)
|
81
81
|
end
|
82
82
|
|
83
83
|
def call(input)
|
@@ -86,8 +86,8 @@ module Mutant
|
|
86
86
|
.lmap do |message|
|
87
87
|
Error.new(
|
88
88
|
cause: nil,
|
89
|
-
input
|
90
|
-
message
|
89
|
+
input:,
|
90
|
+
message:,
|
91
91
|
transform: self
|
92
92
|
)
|
93
93
|
end
|
@@ -102,9 +102,9 @@ module Mutant
|
|
102
102
|
|
103
103
|
def error(cause: nil, input:, message: nil)
|
104
104
|
Error.new(
|
105
|
-
cause
|
106
|
-
input
|
107
|
-
message
|
105
|
+
cause:,
|
106
|
+
input:,
|
107
|
+
message:,
|
108
108
|
transform: self
|
109
109
|
)
|
110
110
|
end
|
@@ -139,10 +139,10 @@ module Mutant
|
|
139
139
|
# @return [Error]
|
140
140
|
def self.wrap(cause, index)
|
141
141
|
Error.new(
|
142
|
-
cause
|
142
|
+
cause:,
|
143
143
|
input: cause.input,
|
144
144
|
message: nil,
|
145
|
-
transform: new(index
|
145
|
+
transform: new(index:, transform: cause.transform)
|
146
146
|
)
|
147
147
|
end
|
148
148
|
|
@@ -159,7 +159,7 @@ module Mutant
|
|
159
159
|
#
|
160
160
|
# @return [Array<String>]
|
161
161
|
def slug
|
162
|
-
'%<index>d' % { index:
|
162
|
+
'%<index>d' % { index: }
|
163
163
|
end
|
164
164
|
memoize :slug
|
165
165
|
end # Index
|
@@ -183,7 +183,7 @@ module Mutant
|
|
183
183
|
else
|
184
184
|
failure(
|
185
185
|
error(
|
186
|
-
input
|
186
|
+
input:,
|
187
187
|
message: MESSAGE % { actual: input.class, expected: primitive }
|
188
188
|
)
|
189
189
|
)
|
@@ -219,7 +219,7 @@ module Mutant
|
|
219
219
|
failure(
|
220
220
|
error(
|
221
221
|
message: MESSAGE % { actual: input.inspect },
|
222
|
-
input:
|
222
|
+
input:
|
223
223
|
)
|
224
224
|
)
|
225
225
|
end
|
@@ -258,8 +258,8 @@ module Mutant
|
|
258
258
|
return failure(
|
259
259
|
error(
|
260
260
|
cause: Index.wrap(error, index),
|
261
|
-
message: MESSAGE % { index:
|
262
|
-
input:
|
261
|
+
message: MESSAGE % { index: },
|
262
|
+
input:
|
263
263
|
)
|
264
264
|
)
|
265
265
|
end.from_right
|
@@ -310,7 +310,7 @@ module Mutant
|
|
310
310
|
# @return [Either<Error, Object>]
|
311
311
|
def call(input)
|
312
312
|
transform.call(input).lmap do |error|
|
313
|
-
error(cause: error, input:
|
313
|
+
error(cause: error, input:)
|
314
314
|
end
|
315
315
|
end
|
316
316
|
end # Key
|
@@ -365,7 +365,7 @@ module Mutant
|
|
365
365
|
|
366
366
|
def coerce_key(key, input)
|
367
367
|
key.call(input.fetch(key.value)).lmap do |error|
|
368
|
-
error(input
|
368
|
+
error(input:, cause: error)
|
369
369
|
end
|
370
370
|
end
|
371
371
|
|
@@ -380,8 +380,8 @@ module Mutant
|
|
380
380
|
else
|
381
381
|
failure(
|
382
382
|
error(
|
383
|
-
input
|
384
|
-
message: KEY_MESSAGE % { missing
|
383
|
+
input:,
|
384
|
+
message: KEY_MESSAGE % { missing:, unexpected: }
|
385
385
|
)
|
386
386
|
)
|
387
387
|
end
|
@@ -413,7 +413,7 @@ module Mutant
|
|
413
413
|
|
414
414
|
steps.each_with_index do |step, index|
|
415
415
|
current = step.call(current).from_right do |error|
|
416
|
-
return failure(error(cause: Index.wrap(error, index), input:
|
416
|
+
return failure(error(cause: Index.wrap(error, index), input:))
|
417
417
|
end
|
418
418
|
end
|
419
419
|
|
@@ -447,7 +447,7 @@ module Mutant
|
|
447
447
|
def call(input)
|
448
448
|
Either
|
449
449
|
.wrap_error(error_class) { block.call(input) }
|
450
|
-
.lmap { |exception| error(input
|
450
|
+
.lmap { |exception| error(input:, message: exception.to_s) }
|
451
451
|
end
|
452
452
|
end # Exception
|
453
453
|
|
data/lib/mutant/variable.rb
CHANGED
data/lib/mutant/version.rb
CHANGED
data/lib/mutant/world.rb
CHANGED
@@ -53,9 +53,9 @@ module Mutant
|
|
53
53
|
|
54
54
|
(process_status.success? ? Either::Right : Either::Left).new(
|
55
55
|
CommandStatus.new(
|
56
|
-
process_status
|
57
|
-
stderr
|
58
|
-
stdout:
|
56
|
+
process_status:,
|
57
|
+
stderr:,
|
58
|
+
stdout:
|
59
59
|
)
|
60
60
|
)
|
61
61
|
end
|
@@ -79,16 +79,16 @@ module Mutant
|
|
79
79
|
def deadline(allowed_time)
|
80
80
|
if allowed_time
|
81
81
|
Timer::Deadline.new(
|
82
|
-
allowed_time
|
83
|
-
timer:
|
82
|
+
allowed_time:,
|
83
|
+
timer:
|
84
84
|
)
|
85
85
|
else
|
86
86
|
Timer::Deadline::None.new
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
def record(name, &
|
91
|
-
recorder.record(name, &
|
90
|
+
def record(name, &)
|
91
|
+
recorder.record(name, &)
|
92
92
|
end
|
93
93
|
|
94
94
|
def process_warmup
|
data/lib/mutant.rb
CHANGED
@@ -291,22 +291,22 @@ module Mutant
|
|
291
291
|
boot_segments = boot_events.map do |name, timestamp_start, timestamp_end|
|
292
292
|
Segment.new(
|
293
293
|
id: gen_id.call,
|
294
|
-
name
|
294
|
+
name:,
|
295
295
|
parent_id: library_segment.id,
|
296
|
-
timestamp_end
|
297
|
-
timestamp_start:
|
296
|
+
timestamp_end:,
|
297
|
+
timestamp_start:
|
298
298
|
)
|
299
299
|
end
|
300
300
|
|
301
301
|
timer = Timer.new(process: Process)
|
302
302
|
|
303
303
|
recorder = Segment::Recorder.new(
|
304
|
-
gen_id
|
304
|
+
gen_id:,
|
305
305
|
root_id: (executable_segment || library_segment).id,
|
306
306
|
parent_id: library_segment.id,
|
307
|
-
recording_start
|
307
|
+
recording_start:,
|
308
308
|
segments: [*executable_segment, library_segment, *boot_segments],
|
309
|
-
timer:
|
309
|
+
timer:
|
310
310
|
)
|
311
311
|
|
312
312
|
WORLD = World.new(
|
@@ -325,13 +325,13 @@ module Mutant
|
|
325
325
|
pathname: Pathname,
|
326
326
|
process: Process,
|
327
327
|
random: Random,
|
328
|
-
recorder
|
328
|
+
recorder:,
|
329
329
|
stderr: $stderr,
|
330
330
|
stdout: $stdout,
|
331
331
|
tempfile: Tempfile,
|
332
332
|
thread: Thread,
|
333
333
|
time: Time,
|
334
|
-
timer:
|
334
|
+
timer:
|
335
335
|
)
|
336
336
|
|
337
337
|
# Reopen class to initialize constant to avoid dep circle
|
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.12.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.6.
|
75
|
+
version: 0.6.14
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.6.
|
82
|
+
version: 0.6.14
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -355,14 +355,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
355
355
|
requirements:
|
356
356
|
- - ">="
|
357
357
|
- !ruby/object:Gem::Version
|
358
|
-
version: '3.
|
358
|
+
version: '3.1'
|
359
359
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
360
360
|
requirements:
|
361
361
|
- - ">="
|
362
362
|
- !ruby/object:Gem::Version
|
363
363
|
version: '0'
|
364
364
|
requirements: []
|
365
|
-
rubygems_version: 3.
|
365
|
+
rubygems_version: 3.3.26
|
366
366
|
signing_key:
|
367
367
|
specification_version: 4
|
368
368
|
summary: ''
|