@@ -262,15 +262,19 @@ function _basic_constraint_test_helper(
262262 # ##
263263 # ## Test MOI.ConstraintFunction
264264 # ##
265+ function _isapprox_simplified (f, g, config)
266+ return isapprox (
267+ MOI. Nonlinear. SymbolicAD. simplify (f),
268+ MOI. Nonlinear. SymbolicAD. simplify (g),
269+ config,
270+ )
271+ end
265272 if _supports (config, MOI. ConstraintFunction)
266273 # Don't compare directly, because `f` might not be canonicalized.
267274 f = MOI. get (model, MOI. ConstraintFunction (), c)
268- @test isapprox (MOI. Utilities. canonical (f), constraint_function, config)
269- @test isapprox (
270- MOI. get (model, MOI. CanonicalConstraintFunction (), c),
271- constraint_function,
272- config,
273- )
275+ @test _isapprox_simplified (f, constraint_function, config)
276+ cf = MOI. get (model, MOI. CanonicalConstraintFunction (), c)
277+ @test _isapprox_simplified (cf, constraint_function, config)
274278 _test_attribute_value_type (model, MOI. ConstraintFunction (), c)
275279 _test_attribute_value_type (model, MOI. CanonicalConstraintFunction (), c)
276280 _test_function_modification (model, config, c, f)
0 commit comments