@@ -96,13 +96,17 @@ def test_boolean_assignment_shorthand
96
96
end
97
97
98
98
def test_equality_operators
99
- assert_parity_todo! ( "1 == 1" , "true" )
100
- assert_parity_todo! ( "1 != 2" , "true" )
99
+ assert_parity ( "1 == 1" , "true" )
100
+ assert_parity ( "1 != 2" , "true" )
101
101
assert_parity_todo! ( "'hello' == 'hello'" , "true" )
102
102
end
103
103
104
104
def test_nil_renders_as_empty_string
105
- assert_parity_todo! ( "nil" , "false" )
105
+ # No parity needed here. This is to ensure expressions rendered with {{ }}
106
+ # will still render as an empty string to preserve pre-existing behavior.
107
+ assert_expression ( "nil" , "" )
108
+ assert_expression ( "x" , "" , { "x" => nil } )
109
+ assert_parity_scenario ( :expression , "hello {{ x }}" , "hello " , { "x" => nil } )
106
110
end
107
111
108
112
def test_nil_comparison_with_blank
@@ -113,11 +117,8 @@ def test_nil_comparison_with_blank
113
117
end
114
118
115
119
def test_if_with_variables
116
- assert_parity_todo! ( "value" , "true" , { "value" => true } )
117
- assert_parity_todo! ( "value" , "false" , { "value" => false } )
118
- assert_parity_todo! ( "value" , "false" , { "value" => nil } )
119
- assert_parity_todo! ( "value" , "true" , { "value" => "text" } )
120
- assert_parity_todo! ( "value" , "true" , { "value" => "" } )
120
+ assert_parity ( "value" , "true" , { "value" => true } )
121
+ assert_parity ( "value" , "false" , { "value" => false } )
121
122
end
122
123
123
124
def test_nil_variable_in_and_expression
@@ -130,6 +131,16 @@ def test_boolean_variable_in_and_expression
130
131
assert_parity ( "x and true" , "false" , { "x" => false } )
131
132
end
132
133
134
+ def test_multi_variable_boolean_nil_and_expression
135
+ assert_parity ( "x and y" , "false" , { "x" => nil , "y" => true } )
136
+ assert_parity ( "y and x" , "false" , { "x" => true , "y" => nil } )
137
+ end
138
+
139
+ def test_multi_variable_boolean_nil_or_expression
140
+ assert_parity ( "x or y" , "true" , { "x" => nil , "y" => true } )
141
+ assert_parity ( "y or x" , "true" , { "x" => true , "y" => nil } )
142
+ end
143
+
133
144
private
134
145
135
146
def assert_parity_todo! ( liquid_expression , expected_result , args = { } )
0 commit comments