Sha256: 8efd67cefe17f371af8195baa808c5cbcf8b17de4ee3e9d553b4c70281074022

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 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,

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

    :excludes => {
    },
  }

  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(
            method == :excludes ? false : true,
            @syntax.implements?(type, token)
          )
        end
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
regexp_parser-0.3.3 test/syntax/ruby/test_1.9.1.rb