Sha256: 5c162fa15f5dfa3ef707c3296dbe5b7589ff43380a4bdce58f3792cf1b5e008f

Contents?: true

Size: 698 Bytes

Versions: 9

Compression:

Stored size: 698 Bytes

Contents

require 'spec_helper'

describe "An expression for braces surrounding zero or more letters followed by semicolons" do
  testing_expression "'{' ([a-z] ';')* '}'"
  
  it "parses matching input successfully" do
    parse('{a;b;c;}').should_not be_nil
  end
  
  it "fails to parse input with an expression that is missing a semicolon, reporting the terminal failure occurring at the maximum index" do
    parse('{a;b;c}') do |result|
      result.should be_nil
      
      terminal_failures = parser.terminal_failures
      terminal_failures.size.should == 1      
      failure = terminal_failures[0]
      failure.index.should == 6
      failure.expected_string.should == "';'"
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
treetop-1.6.8 spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.7 spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.6 spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.5 spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.4 spec/compiler/failure_propagation_functional_spec.rb
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/failure_propagation_functional_spec.rb
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.3 spec/compiler/failure_propagation_functional_spec.rb
treetop-1.6.2 spec/compiler/failure_propagation_functional_spec.rb