File: types_spec.rb

package info (click to toggle)
ruby-regexp-parser 2.11.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,092 kB
  • sloc: ruby: 6,891; makefile: 6; sh: 3
file content (16 lines) | stat: -rw-r--r-- 813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe('Type scanning') do
  include_examples 'scan', 'a\dc', 1 => [:type, :digit,     '\d', 1, 3]
  include_examples 'scan', 'a\Dc', 1 => [:type, :nondigit,  '\D', 1, 3]
  include_examples 'scan', 'a\hc', 1 => [:type, :hex,       '\h', 1, 3]
  include_examples 'scan', 'a\Hc', 1 => [:type, :nonhex,    '\H', 1, 3]
  include_examples 'scan', 'a\sc', 1 => [:type, :space,     '\s', 1, 3]
  include_examples 'scan', 'a\Sc', 1 => [:type, :nonspace,  '\S', 1, 3]
  include_examples 'scan', 'a\wc', 1 => [:type, :word,      '\w', 1, 3]
  include_examples 'scan', 'a\Wc', 1 => [:type, :nonword,   '\W', 1, 3]
  include_examples 'scan', 'a\Rc', 1 => [:type, :linebreak, '\R', 1, 3]
  include_examples 'scan', 'a\Xc', 1 => [:type, :xgrapheme, '\X', 1, 3]
end