diff --git a/test/Bridges/Constraint/bridge.jl b/test/Bridges/Constraint/bridge.jl index 8cd2bf9f89..b3ae367b7a 100644 --- a/test/Bridges/Constraint/bridge.jl +++ b/test/Bridges/Constraint/bridge.jl @@ -26,17 +26,26 @@ struct DummyBridge <: MOI.Bridges.Constraint.AbstractBridge end function test_AbstractBridge() model = MOI.Utilities.Model{Float64}() bridge = DummyBridge() - attr = MOI.ConstraintPrimalStart() - @test !MOI.supports(model, attr, typeof(bridge)) - @test_throws MOI.UnsupportedAttribute(attr) MOI.set( - model, - attr, - bridge, - 1.0, + @test !MOI.supports(model, MOI.ConstraintPrimalStart(), typeof(bridge)) + message = MOI.Bridges._attribute_error_message( + MOI.ConstraintPrimalStart(), + DummyBridge, + "setting a value for", ) - attr = MOI.ConstraintFunction() - err = MOI.SetAttributeNotAllowed(attr) - @test_throws err MOI.set(model, attr, bridge, MOI.EqualTo(1.0)) + @test_throws( + MOI.UnsupportedAttribute(MOI.ConstraintPrimalStart(), message), + MOI.set(model, MOI.ConstraintPrimalStart(), bridge, 1.0), + ) + message = MOI.Bridges._attribute_error_message( + MOI.ConstraintSet(), + DummyBridge, + "setting a value for", + ) + @test_throws( + MOI.SetAttributeNotAllowed(MOI.ConstraintSet(), message), + MOI.set(model, MOI.ConstraintSet(), bridge, MOI.EqualTo(1.0)), + ) + return end end # module