Class: Mutest::Mutator::Node::Regexp::OneOrMore Private

Inherits:
Mutest::Mutator::Node show all
Defined in:
lib/mutest/mutator/node/regexp/one_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 one-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_one_or_more:     :regexp_greedy_interval,
  regexp_reluctant_one_or_more:  :regexp_reluctant_interval,
  regexp_possessive_one_or_more: :regexp_possessive_interval
)
UNBOUNDED =

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.

-1 marks an infinite upper bound

-1

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 `/a2,/`, `/a+?/` with `/a2,?/`, and `/a++/` with `/a2,+/`

Returns:

  • (undefined)


23
24
25
26
27
# File 'lib/mutest/mutator/node/regexp/one_or_more.rb', line 23

def dispatch
  emit(s(MAP.fetch(node.type), 2, UNBOUNDED, subject))
  emit_subject_mutations
  emit(subject)
end