1
0
Fork 0
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:
Matt Wildig 2012-08-15 00:13:28 +01:00
parent a1cfc8dcee
commit 079a8c3a4e

View file

@ -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)