@@ -354,21 +354,21 @@ end
354354
355355 # Test nested custom operators
356356 ex = parse_expression (
357- " custom_max(custom_cos(x1), custom_mul(x2, x3), x4 + 1.5)" ;
357+ " custom_max(custom_cos(x1), custom_mul(x2, x3), x2 + 1.5)" ;
358358 operators= operators,
359+ node_type= Node{T,3 } where {T},
359360 variable_names= [" x1" , " x2" , " x3" ],
360361 )
361- @test typeof (ex) <: Expression
362- @test string_tree (ex) == " custom_max(custom_cos(x1), custom_mul(x2, x3), x4 + 1.5)"
362+ @test typeof (ex) <: Expression{Float64}
363+ @test string_tree (ex) == " custom_max(custom_cos(x1), custom_mul(x2, x3), x2 + 1.5)"
364+ @test ex ([1.0 2.0 3.0 ]' ) == [6.0 ]
363365
364366 # Test error cases for _find_operator_by_name
365367 @test_throws (
366368 ArgumentError (
367369 " Tried to interpolate function `unknown_func` but failed. Function not found in operators." ,
368370 ),
369- parse_expression (
370- Meta. parse (" unknown_func(x1)" ), operators= operators, variable_names= [" x1" ]
371- )
371+ parse_expression (" unknown_func(x1)" , operators= operators, variable_names= [" x1" ])
372372 )
373373
374374 # Test ambiguous operator - same name from different modules
381381 same_name_ops = OperatorEnum (1 => [TestMod1. foo, TestMod2. foo])
382382 @test_throws (
383383 r" Ambiguous operator `foo` with arity 1\. Multiple matches found: Tuple\{ Function, Int64\}\[ .*foo.*1.*foo.*1.*\] " ,
384- parse_expression (
385- Meta. parse (" foo(x1)" ), operators= same_name_ops, variable_names= [" x1" ]
386- )
384+ parse_expression (" foo(x1)" , operators= same_name_ops, variable_names= [" x1" ])
387385 )
388386
389387 # Test wrong arity
392390 " Operator `custom_cos` found but not with arity 2. Available arities: [1]"
393391 ),
394392 parse_expression (
395- Meta. parse (" custom_cos(x1, x2)" ),
396- operators= operators,
397- variable_names= [" x1" , " x2" ],
393+ " custom_cos(x1, x2)" , operators= operators, variable_names= [" x1" , " x2" ]
398394 )
399395 )
400396end
0 commit comments