Sha256: 645155eaffd339aed29c01d969c2bfe042211e8fd87ac55d6818c08bc32db1d1

Contents?: true

Size: 884 Bytes

Versions: 52

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Mutator
    class Util

      # Mutators that mutates an array of inputs
      class Array < self

        # Element presence mutator
        class Presence < Util

        private

          def dispatch
            input.each_index do |index|
              dup = dup_input
              dup.delete_at(index)
              emit(dup)
            end
          end

        end # Presence

        # Array element mutator
        class Element < Util

        private

          def dispatch
            input.each_with_index do |element, index|
              Mutator.mutate(element).each do |mutation|
                dup = dup_input
                dup[index] = mutation
                emit(dup)
              end
            end
          end

        end # Element
      end # Array
    end # Util
  end # Mutator
end # Mutant

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
mutant-0.11.11 lib/mutant/mutator/util/array.rb
mutant-0.11.10 lib/mutant/mutator/util/array.rb
mutant-0.11.9 lib/mutant/mutator/util/array.rb
mutant-0.11.8 lib/mutant/mutator/util/array.rb
mutant-0.11.7 lib/mutant/mutator/util/array.rb
mutant-0.11.6 lib/mutant/mutator/util/array.rb
mutant-0.11.5 lib/mutant/mutator/util/array.rb
mutant-0.11.4 lib/mutant/mutator/util/array.rb
mutant-0.11.3 lib/mutant/mutator/util/array.rb
mutant-0.11.2 lib/mutant/mutator/util/array.rb
mutant-0.11.1 lib/mutant/mutator/util/array.rb
mutant-0.11.0 lib/mutant/mutator/util/array.rb
mutant-0.10.35 lib/mutant/mutator/util/array.rb
mutant-0.10.34 lib/mutant/mutator/util/array.rb
mutant-0.10.33 lib/mutant/mutator/util/array.rb
mutant-0.10.32 lib/mutant/mutator/util/array.rb
mutant-0.10.31 lib/mutant/mutator/util/array.rb
mutant-0.10.30 lib/mutant/mutator/util/array.rb
mutant-0.10.29 lib/mutant/mutator/util/array.rb
mutant-0.10.28 lib/mutant/mutator/util/array.rb