Sha256: 8c0392c6403c4e99630de2dc8531f15f875e19eeaf1ba870e08dd007c6bb44f9
Contents?: true
Size: 851 Bytes
Versions: 46
Compression:
Stored size: 851 Bytes
Contents
# frozen_string_literal: true module Mutant class Mutator class Node # Mutator for when nodes class When < self handle(:when) private def dispatch if body mutate_body else emit_child_update(body_index, N_RAISE) end mutate_conditions end def mutate_conditions conditions = children.length - 1 children[0..-2].each_index do |index| delete_child(index) if conditions > 1 mutate_child(index) end end def mutate_body mutate_child(body_index) end def body children.fetch(body_index) end def body_index children.length - 1 end end # When end # Node end # Mutator end # Mutant
Version data entries
46 entries across 46 versions & 1 rubygems