Class: Evilution::Runner::MutationPlanner Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/runner/mutation_planner.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Plan

Instance Method Summary collapse

Constructor Details

#initialize(config, registry:, disable_detector: Evilution::DisableComment.new, sig_detector: Evilution::AST::SorbetSigDetector.new) ⇒ MutationPlanner

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MutationPlanner.



18
19
20
21
22
23
24
25
26
# File 'lib/evilution/runner/mutation_planner.rb', line 18

def initialize(config, registry:, disable_detector: Evilution::DisableComment.new,
               sig_detector: Evilution::AST::SorbetSigDetector.new)
  @config = config
  @registry = registry
  @disable_detector = disable_detector
  @sig_detector = sig_detector
  @disabled_ranges_cache = {}
  @sig_ranges_cache = {}
end

Instance Method Details

#call(subjects) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
31
32
33
34
35
36
37
# File 'lib/evilution/runner/mutation_planner.rb', line 28

def call(subjects)
  generation = generate(subjects)
  deduped = deduplicate(generation.mutations)
  disabled_filter = filter_disabled(deduped)
  disabled_mutations = compute_disabled_mutations(disabled_filter)
  sig_filter = filter_sig_blocks(disabled_filter.enabled)
  equivalent_filter = filter_equivalent(sig_filter.enabled)

  build_plan(equivalent_filter, disabled_mutations, total_skipped(generation, disabled_filter, sig_filter))
end