Skip to content

Commit

Permalink
Fix failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Jan 23, 2024
1 parent c6ca455 commit 849f679
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions spec/lrama/grammar/rule_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ class : keyword_class tSTRING keyword_end { $classes = $1; }
class: keyword_class tSTRING tSTRING keyword_end { $class = $tSTRING; }
^^^^^^^^
TEXT
expect { Lrama::Parser.new(y, "parse.y").parse }.to raise_error(expected)
expect {
grammar = Lrama::Parser.new(y, "parse.y").parse
grammar.prepare
grammar.validate!
}.to raise_error(expected)
end
end

Expand Down Expand Up @@ -366,7 +370,11 @@ class : keyword_class tSTRING keyword_end { $classes = $1; }
class: class tSTRING keyword_end { $class = $tSTRING; }
^^^^^^
TEXT
expect { Lrama::Parser.new(y, "parse.y").parse }.to raise_error(expected)
expect {
grammar = Lrama::Parser.new(y, "parse.y").parse
grammar.prepare
grammar.validate!
}.to raise_error(expected)
end
end

Expand Down Expand Up @@ -394,7 +402,11 @@ class : keyword_class tSTRING keyword_end { $classes = $1; }
klass[class]: class tSTRING keyword_end { $class = $tSTRING; }
^^^^^^
TEXT
expect { Lrama::Parser.new(y, "parse.y").parse }.to raise_error(expected)
expect {
grammar = Lrama::Parser.new(y, "parse.y").parse
grammar.prepare
grammar.validate!
}.to raise_error(expected)
end
end

Expand Down Expand Up @@ -422,7 +434,11 @@ class : keyword_class tSTRING keyword_end { $classes = $1; }
klass[class]: Klass[class] tSTRING keyword_end { $class = $tSTRING; }
^^^^^^
TEXT
expect { Lrama::Parser.new(y, "parse.y").parse }.to raise_error(expected)
expect {
grammar = Lrama::Parser.new(y, "parse.y").parse
grammar.prepare
grammar.validate!
}.to raise_error(expected)
end
end
end
Expand Down

0 comments on commit 849f679

Please sign in to comment.