From 079a8c3a4e6c0a2900aff17ae2587b7cd4af2502 Mon Sep 17 00:00:00 2001 From: Matt Wildig Date: Wed, 15 Aug 2012 00:13:28 +0100 Subject: [PATCH] Add test for closing loud scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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." --- test/parser_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/parser_test.rb b/test/parser_test.rb index 1db56a4d..2151c98a 100644 --- a/test/parser_test.rb +++ b/test/parser_test.rb @@ -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)