Sha256: 7b5835439bc48c7e633422e6175b5fd8ae02e207285d1b5bf65a9f9c22dacfcd

Contents?: true

Size: 1.31 KB

Versions: 29

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

RSpec.describe('Quantifier scanning') do
  include_examples 'scan', 'a?',     1 => [:quantifier,  :zero_or_one,             '?',     1, 2]
  include_examples 'scan', 'a??',    1 => [:quantifier,  :zero_or_one_reluctant,   '??',    1, 3]
  include_examples 'scan', 'a?+',    1 => [:quantifier,  :zero_or_one_possessive,  '?+',    1, 3]

  include_examples 'scan', 'a*',     1 => [:quantifier,  :zero_or_more,            '*',     1, 2]
  include_examples 'scan', 'a*?',    1 => [:quantifier,  :zero_or_more_reluctant,  '*?',    1, 3]
  include_examples 'scan', 'a*+',    1 => [:quantifier,  :zero_or_more_possessive, '*+',    1, 3]

  include_examples 'scan', 'a+',     1 => [:quantifier,  :one_or_more,             '+',     1, 2]
  include_examples 'scan', 'a+?',    1 => [:quantifier,  :one_or_more_reluctant,   '+?',    1, 3]
  include_examples 'scan', 'a++',    1 => [:quantifier,  :one_or_more_possessive,  '++',    1, 3]

  include_examples 'scan', 'a{2}',   1 => [:quantifier,  :interval,                '{2}',   1, 4]
  include_examples 'scan', 'a{2,}',  1 => [:quantifier,  :interval,                '{2,}',  1, 5]
  include_examples 'scan', 'a{,2}',  1 => [:quantifier,  :interval,                '{,2}',  1, 5]
  include_examples 'scan', 'a{2,4}', 1 => [:quantifier,  :interval,                '{2,4}', 1, 6]
end

Version data entries

29 entries across 24 versions & 6 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/quantifiers_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/spec/scanner/quantifiers_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.2/spec/scanner/quantifiers_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.2/spec/scanner/quantifiers_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/spec/scanner/quantifiers_spec.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/spec/scanner/quantifiers_spec.rb
regexp_parser-1.8.2 spec/scanner/quantifiers_spec.rb
regexp_parser-1.8.1 spec/scanner/quantifiers_spec.rb
regexp_parser-1.8.0 spec/scanner/quantifiers_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.7.1/spec/scanner/quantifiers_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.7.0/spec/scanner/quantifiers_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.7.1/spec/scanner/quantifiers_spec.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/regexp_parser-1.7.1/spec/scanner/quantifiers_spec.rb
regexp_parser-1.7.1 spec/scanner/quantifiers_spec.rb
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.7.0/spec/scanner/quantifiers_spec.rb