spec/rley/parser/earley_parser_spec.rb in rley-0.2.04 vs spec/rley/parser/earley_parser_spec.rb in rley-0.2.05

- old
+ new

@@ -555,11 +555,17 @@ Token.new('a', a_), Token.new('a', a_), Token.new('c', c_), Token.new('c', c_) ] - parse_result = subject.parse(wrong) + err_msg = <<-MSG +Syntax error at or near token 3>>>c<<<: +Expected one of: ['a', 'b'], found a 'c' instead. +MSG + err = StandardError + expect { subject.parse(wrong)}.to raise_error(err, err_msg.chomp) +=begin expect(parse_result.success?).to eq(false) ###################### S(0) == . a a c c # Expectation chart[0]: expected = [ @@ -587,9 +593,10 @@ ###################### S(3) == a a c? c state_set_3 = parse_result.chart[3] expect(state_set_3.states).to be_empty # This is an error symptom +=end end it 'should parse a grammar with nullable nonterminals' do # Grammar 4: A grammar with nullable nonterminal # based on example in "Parsing Techniques" book (D. Grune, C. Jabobs)