Sha256: 9ca2a58956d709654847918088c9837a70ece7514ba454c863899f863e540ee5

Contents?: true

Size: 533 Bytes

Versions: 7

Compression:

Stored size: 533 Bytes

Contents

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

class LexerKeep < Test::Unit::TestCase

  def test_lex_keep_token
    regexp = /ab\Kcd/
    tokens = RL.lex(regexp)

    assert_equal( :keep, tokens[1].type )
    assert_equal( :mark, tokens[1].token )
  end

  def test_lex_keep_nested
    regexp = /(a\Kb)|(c\\\Kd)ef/
    tokens = RL.lex(regexp)

    assert_equal( :keep, tokens[2].type )
    assert_equal( :mark, tokens[2].token )

    assert_equal( :keep, tokens[9].type )
    assert_equal( :mark, tokens[9].token )
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
regexp_parser-0.3.4 test/lexer/test_keep.rb
regexp_parser-0.3.3 test/lexer/test_keep.rb
regexp_parser-0.3.2 test/lexer/test_keep.rb
regexp_parser-0.3.1 test/lexer/test_keep.rb
regexp_parser-0.3.0 test/lexer/test_keep.rb
regexp_parser-0.2.1 test/lexer/test_keep.rb
regexp_parser-0.2.0 test/lexer/test_keep.rb