mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Add line numbers to warnings
This commit is contained in:
committed by
Florian Weingarten
parent
3a0ee6ae91
commit
27c1019385
@@ -121,6 +121,12 @@ class ErrorHandlingTest < Minitest::Test
|
||||
assert_equal '', template.render
|
||||
end
|
||||
|
||||
def test_warning_line_numbers
|
||||
template = Liquid::Template.parse("{% if ~~~ %}\n{{%%%}}{% else %}\n{{ hello. }}{% endif %}", :error_mode => :warn, :line_numbers => true)
|
||||
assert_equal 3, template.warnings.size
|
||||
assert_equal [1,2,3], template.warnings.map(&:line_number)
|
||||
end
|
||||
|
||||
# Liquid should not catch Exceptions that are not subclasses of StandardError, like Interrupt and NoMemoryError
|
||||
def test_exceptions_propagate
|
||||
assert_raises Exception do
|
||||
|
||||
Reference in New Issue
Block a user