Sha256: 8b30d58b3eb24db84b97735fe541aa3cf2683d8b0fbb66a715e9f60648c59188

Contents?: true

Size: 474 Bytes

Versions: 17

Compression:

Stored size: 474 Bytes

Contents

require File.expand_path("../../helpers", __FILE__)

class ExpressionSubexpression < Test::Unit::TestCase

  def test_subexpression_ts_te
    regx = /abcd|ghij|klmn|pqur/
    root = RP.parse(regx)

    alt = root.first

    {
      0 => [  0,  4 ],
      1 => [  5,  9 ],
      2 => [ 10, 14 ],
      3 => [ 15, 19 ],
    }.each do |index, span|
      sequence = alt[index]

      assert_equal span[0], sequence.ts
      assert_equal span[1], sequence.te
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
regexp_parser-0.5.0 test/expression/test_subexpression.rb
regexp_parser-0.4.13 test/expression/test_subexpression.rb
regexp_parser-0.4.12 test/expression/test_subexpression.rb
regexp_parser-0.4.11 test/expression/test_subexpression.rb
regexp_parser-0.4.10 test/expression/test_subexpression.rb
regexp_parser-0.4.9 test/expression/test_subexpression.rb
regexp_parser-0.4.8 test/expression/test_subexpression.rb
regexp_parser-0.4.7 test/expression/test_subexpression.rb
regexp_parser-0.4.6 test/expression/test_subexpression.rb
regexp_parser-0.4.5 test/expression/test_subexpression.rb
regexp_parser-0.4.4 test/expression/test_subexpression.rb
regexp_parser-0.4.3 test/expression/test_subexpression.rb
regexp_parser-0.4.2 test/expression/test_subexpression.rb
regexp_parser-0.4.1 test/expression/test_subexpression.rb
regexp_parser-0.4.0 test/expression/test_subexpression.rb
regexp_parser-0.3.6 test/expression/test_subexpression.rb
regexp_parser-0.3.5 test/expression/test_subexpression.rb