mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 09:20:42 -07:00
fix parsing quirky incomplete expressions
This commit is contained in:
@@ -102,4 +102,11 @@ class LexerUnitTest < Minitest::Test
|
||||
Lexer.new("a.contains.b").tokenize,
|
||||
)
|
||||
end
|
||||
|
||||
def test_tokenize_incomplete_expression
|
||||
assert_equal([[:id, "false"], [:dash, "-"], [:end_of_string]], Lexer.new("false -").tokenize)
|
||||
assert_equal([[:id, "false"], [:comparison, "<"], [:end_of_string]], Lexer.new("false <").tokenize)
|
||||
assert_equal([[:id, "false"], [:comparison, ">"], [:end_of_string]], Lexer.new("false >").tokenize)
|
||||
assert_equal([[:id, "false"], [:number, "1"], [:end_of_string]], Lexer.new("false 1").tokenize)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user