From 83f0ac54240e792376cee60ac59f7dc528785540 Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Wed, 3 Dec 2025 16:05:49 -0500 Subject: [PATCH] Add boolean expressions as variable unit tests --- test/integration/variable_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/variable_test.rb b/test/integration/variable_test.rb index 38096e41..b81a2106 100644 --- a/test/integration/variable_test.rb +++ b/test/integration/variable_test.rb @@ -11,6 +11,24 @@ class VariableTest < Minitest::Test assert_template_result('worked wonderfully', "{{test}}", { 'test' => 'worked wonderfully' }) end + def test_equality + assert_template_result('true', "{{ 5 == 5 }}") + assert_template_result('false', "{{ 5 == 3 }}") + end + + def test_comparison + assert_template_result('true', "{{ 5 > 3 }}") + assert_template_result('false', "{{ 5 < 3 }}") + end + + def test_expression_piped_into_filter + assert_template_result('TRUE', "{{ 5 == 5 | upcase }}") + end + + def test_expression_used_as_filter_argument + assert_template_result('A: TRUE', "{{ 'a: $a' | replace: '$a', 5 == 5 | upcase }}") + end + def test_variable_render_calls_to_liquid assert_template_result('foobar', '{{ foo }}', { 'foo' => ThingWithToLiquid.new }) end