Sha256: 290d13453b67c8af5f329a597d11dc46652049ad52714980efb5f8ee1410322e

Contents?: true

Size: 704 Bytes

Versions: 6

Compression:

Stored size: 704 Bytes

Contents

dir = File.dirname(__FILE__)
require "#{dir}/../test_helper"

class AnythingSymbolTest < CompilerTestCase  
  class Foo < Treetop::Runtime::SyntaxNode
  end
  
  testing_expression '. <Foo> { def a_method; end }'
  
  it "matches any single character in a big range, returning an instance of the declared node class that responds to methods defined in the inline module" do
    (33..127).each do |digit|
      parse(digit.chr) do |result|
        result.should be_success
        result.should be_an_instance_of(Foo)
        result.should respond_to(:a_method)
        result.interval.should == (0...1)
      end
    end
  end
  
  it "fails to parse epsilon" do
    parse('').should be_failure
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
treetop-1.1.2 test/compiler/anything_symbol_test.rb
treetop-1.0.0 test/compiler/anything_symbol_test.rb
treetop-1.0.1 test/compiler/anything_symbol_test.rb
treetop-1.0.2 test/compiler/anything_symbol_test.rb
treetop-1.1.1 test/compiler/anything_symbol_test.rb
treetop-1.1.0 test/compiler/anything_symbol_test.rb