Sha256: 24da3c80087d0e2c0dc2a61ca2e2506edfb6f818a820da082c3a6945a3aba4b5

Contents?: true

Size: 889 Bytes

Versions: 6

Compression:

Stored size: 889 Bytes

Contents

# encoding: utf-8

module Mutant
  class Mutator
    class Node
      class Literal < self
        # Mutator for fixnum literals
        class Fixnum < self

          handle(:int)

        private

          # Emit mutants
          #
          # @return [undefined]
          #
          # @api private
          #
          def dispatch
            emit_nil
            emit_values(values)
          end

          # Return values to mutate against
          #
          # @return [Array]
          #
          # @api private
          #
          def values
            [0, 1, -value, value + 1, value - 1]
          end

          # Return value
          #
          # @return [Object]
          #
          # @api private
          #
          def value
            children.first
          end

        end # Fixnuma
      end # Literal
    end # Node
  end # Mutator
end # Mutant

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.5.18 lib/mutant/mutator/node/literal/fixnum.rb
mutant-0.5.17 lib/mutant/mutator/node/literal/fixnum.rb
mutant-0.5.16 lib/mutant/mutator/node/literal/fixnum.rb
mutant-0.5.15 lib/mutant/mutator/node/literal/fixnum.rb
mutant-0.5.14 lib/mutant/mutator/node/literal/fixnum.rb
mutant-0.5.13 lib/mutant/mutator/node/literal/fixnum.rb