@@ -163,7 +163,6 @@ func TestTruncate(t *testing.T) {
163163 res , err := f .Eval (sql .NewEmptyContext (), nil )
164164 require .NoError (t , err )
165165
166- // Special handling for decimal types
167166 if tt .name == "decimal input" {
168167 if dec , ok := res .(decimal.Decimal ); ok {
169168 require .Equal (t , tt .exp , dec .String ())
@@ -180,21 +179,18 @@ func TestTruncate(t *testing.T) {
180179func TestTruncateWithChildren (t * testing.T ) {
181180 req := require .New (t )
182181
183- // Test WithChildren
184182 f := NewTruncate (
185183 expression .NewLiteral (1.223 , types .Float64 ),
186184 expression .NewLiteral (1 , types .Int32 ),
187185 )
188186
189- // Test that WithChildren returns a new instance
190187 newF , err := f .WithChildren (
191188 expression .NewLiteral (2.456 , types .Float64 ),
192189 expression .NewLiteral (2 , types .Int32 ),
193190 )
194191 req .NoError (err )
195192 req .NotEqual (f , newF )
196193
197- // Test that the new function works correctly
198194 res , err := newF .Eval (sql .NewEmptyContext (), nil )
199195 req .NoError (err )
200196 req .Equal (2.45 , res )
@@ -214,32 +210,28 @@ func TestTruncateString(t *testing.T) {
214210func TestTruncateType (t * testing.T ) {
215211 req := require .New (t )
216212
217- // Test with numeric input
218213 f := NewTruncate (
219214 expression .NewLiteral (1.223 , types .Float64 ),
220215 expression .NewLiteral (1 , types .Int32 ),
221216 )
222217 req .Equal (types .Float64 , f .Type ())
223218
224- // Test with text input
225219 f = NewTruncate (
226220 expression .NewLiteral ("1.223" , types .Text ),
227221 expression .NewLiteral (1 , types .Int32 ),
228222 )
229- req .Equal (types .Float64 , f .Type ()) // Text input should return DOUBLE
223+ req .Equal (types .Float64 , f .Type ())
230224}
231225
232226func TestTruncateIsNullable (t * testing.T ) {
233227 req := require .New (t )
234228
235- // Test with nullable inputs
236229 f := NewTruncate (
237230 expression .NewLiteral (nil , types .Null ),
238231 expression .NewLiteral (1 , types .Int32 ),
239232 )
240233 req .True (f .IsNullable ())
241234
242- // Test with non-nullable inputs
243235 f = NewTruncate (
244236 expression .NewLiteral (1.223 , types .Float64 ),
245237 expression .NewLiteral (1 , types .Int32 ),
0 commit comments