Sha256: a13f74c84aa720a1d1da7d4077222ce4d3534f664cb6c4368b55f9694ff07ee3

Contents?: true

Size: 729 Bytes

Versions: 3

Compression:

Stored size: 729 Bytes

Contents

mutations = {
  [:regexp_digit_type,           '/\d/'] => [:regexp_nondigit_type,           '/\D/'],
  [:regexp_hex_type,             '/\h/'] => [:regexp_nonhex_type,             '/\H/'],
  [:regexp_space_type,           '/\s/'] => [:regexp_nonspace_type,           '/\S/'],
  [:regexp_word_boundary_anchor, '/\b/'] => [:regexp_nonword_boundary_anchor, '/\B/'],
  [:regexp_word_type,            '/\w/'] => [:regexp_nonword_type,            '/\W/']
}

mutations = mutations.merge(mutations.invert)

mutations.each do |(source_type, source_mutation), (_, regexp_mutation)|
  Mutant::Meta::Example.add source_type do
    source(source_mutation)

    singleton_mutations
    regexp_mutations

    mutation(regexp_mutation)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mutant-0.8.14 meta/regexp/character_types.rb
mutant-0.8.13 meta/regexp/character_types.rb
mutant-0.8.12 meta/regexp/character_types.rb