Sha256: dac73609bd01dbcb0d29534b9607b1e19f442b42f6cffa6204834d3abd07e11a

Contents?: true

Size: 1.57 KB

Versions: 20

Compression:

Stored size: 1.57 KB

Contents

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

class ParserErrors < Test::Unit::TestCase

  def test_parser_unknown_token_type
    assert_raise( Regexp::Parser::UnknownTokenTypeError ) {
      RP.parse_token(Regexp::Token.new(:foo, :bar))
    }
  end

  def test_parser_unknown_set_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:set, :foo))
    }
  end

  def test_parser_unknown_meta_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:meta, :foo))
    }
  end

  def test_parser_unknown_character_type_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:type, :foo))
    }
  end

  def test_parser_unknown_unicode_property_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:property, :foo))
    }
  end

  def test_parser_unknown_unicode_nonproperty_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:nonproperty, :foo))
    }
  end

  def test_parser_unknown_anchor_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:anchor, :foo))
    }
  end

  def test_parser_unknown_quantifier_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:quantifier, :foo))
    }
  end

  def test_parser_unknown_group_open_token
    assert_raise( Regexp::Parser::UnknownTokenError ) {
      RP.parse_token(Regexp::Token.new(:group, :foo))
    }
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
regexp_parser-0.4.6 test/parser/test_errors.rb
regexp_parser-0.4.5 test/parser/test_errors.rb
regexp_parser-0.4.4 test/parser/test_errors.rb
regexp_parser-0.4.3 test/parser/test_errors.rb
regexp_parser-0.4.2 test/parser/test_errors.rb
regexp_parser-0.4.1 test/parser/test_errors.rb
regexp_parser-0.4.0 test/parser/test_errors.rb
regexp_parser-0.3.6 test/parser/test_errors.rb
regexp_parser-0.3.5 test/parser/test_errors.rb
regexp_parser-0.3.4 test/parser/test_errors.rb
regexp_parser-0.3.3 test/parser/test_errors.rb
regexp_parser-0.3.2 test/parser/test_errors.rb
regexp_parser-0.3.1 test/parser/test_errors.rb
regexp_parser-0.3.0 test/parser/test_errors.rb
regexp_parser-0.2.1 test/parser/test_errors.rb
regexp_parser-0.2.0 test/parser/test_errors.rb
regexp_parser-0.1.6 test/parser/test_errors.rb
regexp_parser-0.1.5 test/parser/test_errors.rb
regexp_parser-0.1.1 test/parser/test_errors.rb
regexp_parser-0.1.0 test/parser/test_errors.rb