Sha256: a7f2b12a0a58838ba31dd1308fd05076e12464db9821483faf9185fc206bf42e

Contents?: true

Size: 672 Bytes

Versions: 25

Compression:

Stored size: 672 Bytes

Contents

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

class ExpressionFreeSpace < Test::Unit::TestCase

  def test_expression_white_space_quantify_raises_error
    regexp = %r{
      a # Comment
    }x

    root = RP.parse(regexp)

    space = root[0]
    assert_equal FreeSpace::WhiteSpace, space.class

    assert_raise( RuntimeError ) {
      space.quantify(:dummy, '#')
    }
  end

  def test_expression_comment_quantify_raises_error
    regexp = %r{
      a # Comment
    }x

    root = RP.parse(regexp)

    comment = root[3]
    assert_equal FreeSpace::Comment, comment.class

    assert_raise( RuntimeError ) {
      comment.quantify(:dummy, '#')
    }
  end

end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
tdiary-5.0.13 vendor/bundle/gems/regexp_parser-1.3.0/test/expression/test_free_space.rb
regexp_parser-1.4.0 test/expression/test_free_space.rb
tdiary-5.0.12.1 vendor/bundle/gems/regexp_parser-1.3.0/test/expression/test_free_space.rb
tdiary-5.0.11 vendor/bundle/gems/regexp_parser-1.3.0/test/expression/test_free_space.rb
regexp_parser-1.3.0 test/expression/test_free_space.rb
regexp_parser-1.2.0 test/expression/test_free_space.rb
regexp_parser-1.1.0 test/expression/test_free_space.rb
regexp_parser-1.0.0 test/expression/test_free_space.rb
regexp_parser-0.5.0 test/expression/test_free_space.rb
regexp_parser-0.4.13 test/expression/test_free_space.rb
regexp_parser-0.4.12 test/expression/test_free_space.rb
regexp_parser-0.4.11 test/expression/test_free_space.rb
regexp_parser-0.4.10 test/expression/test_free_space.rb
regexp_parser-0.4.9 test/expression/test_free_space.rb
regexp_parser-0.4.8 test/expression/test_free_space.rb
regexp_parser-0.4.7 test/expression/test_free_space.rb
regexp_parser-0.4.6 test/expression/test_free_space.rb
regexp_parser-0.4.5 test/expression/test_free_space.rb
regexp_parser-0.4.4 test/expression/test_free_space.rb
regexp_parser-0.4.3 test/expression/test_free_space.rb