mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
fix parsing quirky incomplete expressions
This commit is contained in:
@@ -136,4 +136,11 @@ class LexerUnitTest < Minitest::Test
|
|||||||
def tokenize(input)
|
def tokenize(input)
|
||||||
Lexer.new(input).tokenize
|
Lexer.new(input).tokenize
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user