Sha256: a0b7bfcecf60ede9a9c15a7a25cf3e9aeef611c252167037a062dbbc3cdf973c

Contents?: true

Size: 816 Bytes

Versions: 2

Compression:

Stored size: 816 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/'],
  [:regexp_xgrapheme_type,       '/\X/'] => [:regexp_space_type,              '/\s/']
}

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.16 meta/regexp/character_types.rb
mutant-0.8.15 meta/regexp/character_types.rb