Sha256: 392c3d66c00fcbe8f924e83e415037f7ae755d0f76faf5f157ca2367adb98f31

Contents?: true

Size: 823 Bytes

Versions: 8

Compression:

Stored size: 823 Bytes

Contents

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

class TestSyntaxRuby_V191 < Test::Unit::TestCase
  include Regexp::Syntax::Token

  def setup
    @syntax = Regexp::Syntax.new 'ruby/1.9.1'
  end

  tests = {
    :implements => {
      :escape => [
        Escape::Backreference + Escape::ASCII + Escape::Meta + Escape::Unicode
      ].flatten,

      :type => [
        CharacterType::Hex
      ].flatten,

      :quantifier => [
        Quantifier::Greedy + Quantifier::Reluctant +
        Quantifier::Possessive
      ].flatten,
    },
  }

  tests.each do |method, types|
    types.each do |type, tokens|
      tokens.each do |token|
        define_method "test_syntax_ruby_v191_#{method}_#{type}_#{token}" do
          assert_equal true, @syntax.implements?(type, token)
        end
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
regexp_parser-0.4.5 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.4.4 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.4.3 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.4.2 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.4.1 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.4.0 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.3.6 test/syntax/ruby/test_1.9.1.rb
regexp_parser-0.3.5 test/syntax/ruby/test_1.9.1.rb