Sha256: 6258e0c9bddb8637e5d314c336206cb44fc9025bcebea789b2d992b8ac2b05cb

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

module Mutant
  class Mutator
    class Node
      module Regexp
        # Mutator for greedy zero-or-more quantifier, `*`
        class GreedyZeroOrMore < Node
          handle(:regexp_greedy_zero_or_more)

          children :min, :max, :subject

          # Emit mutations
          #
          # Replace `/a*/` with `/a+/`
          #
          # @return [undefined]
          def dispatch
            emit(s(:regexp_greedy_one_or_more, *children))
            emit_subject_mutations
            emit(subject)
          end
        end # GreedyZeroOrMore
      end # Regexp
    end # Node
  end # Mutator
end # Mutant

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.8.16 lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb
mutant-0.8.15 lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb
mutant-0.8.14 lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb
mutant-0.8.13 lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb
mutant-0.8.12 lib/mutant/mutator/node/regexp/greedy_zero_or_more.rb