Class: Mutest::Mutator::Node::Regexp::ZeroOrMore Private

Inherits:
Mutest::Mutator::Node show all
Defined in:
lib/mutest/mutator/node/regexp/zero_or_more.rb

Overview

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.

Mutator for zero-or-more quantifier, ‘*`

Constant Summary collapse

MAP =

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

IceNine.deep_freeze(
  regexp_greedy_zero_or_more:     :regexp_greedy_one_or_more,
  regexp_reluctant_zero_or_more:  :regexp_reluctant_one_or_more,
  regexp_possessive_zero_or_more: :regexp_possessive_one_or_more
)

Constants inherited from Mutest::Mutator::Node

TAUTOLOGY

Constants included from AST::Nodes

AST::Nodes::N_EMPTY, AST::Nodes::N_EMPTY_SUPER, AST::Nodes::N_FALSE, AST::Nodes::N_INFINITY, AST::Nodes::N_NAN, AST::Nodes::N_NEGATIVE_INFINITY, AST::Nodes::N_NIL, AST::Nodes::N_RAISE, AST::Nodes::N_SELF, AST::Nodes::N_TRUE, AST::Nodes::N_ZSUPER

Constants inherited from Mutest::Mutator

REGISTRY

Instance Attribute Summary

Attributes inherited from Mutest::Mutator

#output

Instance Method Summary collapse

Methods included from AST::NamedChildren

included

Methods inherited from Mutest::Mutator

mutate

Instance Method Details

#dispatchundefined

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.

Replace ‘/a*/` with `/a+/`, `/a*?/` with `/a+?/`, and `/a*+/` with `/a++/`

Returns:

  • (undefined)


20
21
22
23
24
# File 'lib/mutest/mutator/node/regexp/zero_or_more.rb', line 20

def dispatch
  emit(s(MAP.fetch(node.type), *children))
  emit_subject_mutations
  emit(subject)
end