Sha256: 638ddd48fabfff50a1b502e88527f5a7a7c376e4d14e61f98fb5a37d10845081

Contents?: true

Size: 1.76 KB

Versions: 40

Compression:

Stored size: 1.76 KB

Contents

require 'spec_helper'

RSpec.describe('Literal delimiter scanning') do
  include_examples 'scan', '}',
    0 => [:literal,     :literal,       '}',        0,  1]

  include_examples 'scan', '}}',
    0 => [:literal,     :literal,       '}}',       0,  2]

  include_examples 'scan', '{',
    0 => [:literal,     :literal,       '{',        0,  1]

  include_examples 'scan', '{{',
    0 => [:literal,     :literal,       '{{',       0,  2]

  include_examples 'scan', '{}',
    0 => [:literal,     :literal,       '{}',       0,  2]

  include_examples 'scan', '}{',
    0 => [:literal,     :literal,       '}{',       0,  2]

  include_examples 'scan', '}{+',
    0 => [:literal,     :literal,       '}{',       0,  2]

  include_examples 'scan', '{{var}}',
    0 => [:literal,     :literal,       '{{var}}',  0,  7]

  include_examples 'scan', 'a{1,2',
    0 => [:literal,     :literal,       'a{1,2',    0,  5]

  include_examples 'scan', '({.+})',
    0 => [:group,       :capture,       '(',        0,  1],
    1 => [:literal,     :literal,       '{',        1,  2],
    2 => [:meta,        :dot,           '.',        2,  3],
    3 => [:quantifier,  :one_or_more,   '+',        3,  4],
    4 => [:literal,     :literal,       '}',        4,  5],
    5 => [:group,       :close,         ')',        5,  6]

  include_examples 'scan', ']',
    0 => [:literal,     :literal,       ']',        0,  1]

  include_examples 'scan', ']]',
    0 => [:literal,     :literal,       ']]',       0,  2]

  include_examples 'scan', ']\[',
    0 => [:literal,     :literal,       ']',        0,  1],
    1 => [:escape,      :set_open,      '\[',       1,  3]

  include_examples 'scan', '()',
    0 => [:group,       :capture,       '(',        0,  1],
    1 => [:group,       :close,         ')',        1,  2]
end

Version data entries

40 entries across 30 versions & 9 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/regexp_parser-2.2.0/spec/scanner/delimiters_spec.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
regexp_parser-2.2.0 spec/scanner/delimiters_spec.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/spec/scanner/delimiters_spec.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/spec/scanner/delimiters_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/delimiters_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-2.0.3/spec/scanner/delimiters_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/delimiters_spec.rb