Sha256: 1e1f38d437bac12f2eea29fcb0fdfb4c0819fe51265b40fbfa51b26dcf42a57b

Contents?: true

Size: 1.9 KB

Versions: 1

Compression:

Stored size: 1.9 KB

Contents

module Mutest
  class Mutator
    class Node
      # Generic mutator
      class Generic < self
        unsupported_nodes = %i[
          cbase
          ensure
          redo
          retry
          arg_expr
          blockarg
          undef
          module
          empty
          alias
          for
          xstr
          back_ref
          sclass
          match_with_lvasgn
          while_post
          until_post
          preexe
          postexe
          iflipflop
          eflipflop
          kwsplat
          shadowarg
          rational
          complex
          __FILE__
          __LINE__
          __ENCODING__
        ]

        unsupported_regexp_nodes = AST::Types::REGEXP.to_a - %i[
          regexp_alternation_meta
          regexp_bol_anchor
          regexp_capture_group
          regexp_digit_type
          regexp_eol_anchor
          regexp_eos_ob_eol_anchor
          regexp_greedy_one_or_more
          regexp_greedy_zero_or_more
          regexp_hex_type
          regexp_nondigit_type
          regexp_nonhex_type
          regexp_nonspace_type
          regexp_nonword_boundary_anchor
          regexp_nonword_type
          regexp_possessive_one_or_more
          regexp_possessive_zero_or_more
          regexp_reluctant_one_or_more
          regexp_reluctant_zero_or_more
          regexp_root_expression
          regexp_space_type
          regexp_word_boundary_anchor
          regexp_word_type
        ]

        # These nodes still need a dedicated mutator,
        # your contribution is that close!
        handle(*(unsupported_nodes + unsupported_regexp_nodes))

        private

        # Emit mutations
        #
        # @return [undefined]
        def dispatch
          children.each_with_index do |child, index|
            mutate_child(index) if child.instance_of?(::Parser::AST::Node)
          end
        end
      end # Generic
    end # Node
  end # Mutator
end # Mutest

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutest-0.0.9 lib/mutest/mutator/node/generic.rb