From 2abf52d5465004a30dc303a280838de862b84388 Mon Sep 17 00:00:00 2001 From: Michael Go Date: Wed, 8 Nov 2023 11:23:00 -0400 Subject: [PATCH] add a quirky comment tag unit test --- test/unit/tags/comment_tag_unit_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/unit/tags/comment_tag_unit_test.rb b/test/unit/tags/comment_tag_unit_test.rb index 457d224a..f201e277 100644 --- a/test/unit/tags/comment_tag_unit_test.rb +++ b/test/unit/tags/comment_tag_unit_test.rb @@ -20,6 +20,16 @@ class CommentTagUnitTest < Minitest::Test assert_equal("", template.render) end + def test_allows_incomplete_tags_inside_a_comment + template = Liquid::Template.parse(<<~LIQUID.chomp, line_numbers: true) + {% comment %} + {% assign foo = "1" + {% endcomment %} + LIQUID + + assert_equal("", template.render) + end + def test_child_comment_tags_need_to_be_closed template = Liquid::Template.parse(<<~LIQUID.chomp, line_numbers: true) {% comment %}