mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add test for closing loud scripts
"Loud" script nodes aren’t being closed, and so the @script_stack_level isn't popped correctly, causing parse errors: -if true =if true - 'A' -else B gives "Syntax error on line 4: "else" is indented at wrong level: expected 1, but was at 0."
This commit is contained in:
parent
a1cfc8dcee
commit
079a8c3a4e
1 changed files with 9 additions and 0 deletions
|
@ -76,6 +76,15 @@ module Haml
|
|||
end
|
||||
end
|
||||
|
||||
test "else after nested loud script is accepted" do
|
||||
begin
|
||||
parse "-if true\n =if true\n - 'A'\n-else\n B"
|
||||
assert true
|
||||
rescue SyntaxError
|
||||
flunk 'else after nested loud script should be accepted'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse(haml, options = nil)
|
||||
|
|
Loading…
Reference in a new issue