Sha256: 8e345b78e02b7a2608313a5176328767a14ee9aa4a0de86a06dacf82e54af5dc

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

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/'],
  [:regexp_xgrapheme_type,       '/\X/'] => [:regexp_linebreak_type,          '/\R/']
}

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

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.8.20 meta/regexp/character_types.rb
mutant-0.8.19 meta/regexp/character_types.rb