Add whitespace control character and associated tests

This commit is contained in:
Michael Angell
2016-06-28 09:15:45 +10:00
parent 19c6eb426a
commit e1d40c7d89
5 changed files with 563 additions and 4 deletions
+16
View File
@@ -97,6 +97,22 @@ class ErrorHandlingTest < Minitest::Test
assert_match(/Liquid syntax error \(line 4\)/, err.message)
end
def test_with_line_numbers_adds_numbers_to_parser_errors_with_whitespace_trim
err = assert_raises(SyntaxError) do
Liquid::Template.parse(%q(
foobar
{%- "cat" | foobar -%}
bla
),
line_numbers: true
)
end
assert_match(/Liquid syntax error \(line 4\)/, err.message)
end
def test_parsing_warn_with_line_numbers_adds_numbers_to_lexer_errors
template = Liquid::Template.parse('
foobar