Skip to content

Commit

Permalink
cover, test and depretest the length of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jan 8, 2025
1 parent 14abc80 commit 5253159
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bound.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ $(TYPEDSIGNATURES)
will be removed in a future release.
"""
function Base.length(x::Bound)
Base.depwarn("length(::Bound) will be removed in future release.", :length)
Base.depwarn(
"length(::Bound) is deprecated and will be removed in future release.",
:length,
)
return 1
end

Expand Down
6 changes: 6 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
import ConstraintTrees as C
import SparseArrays as SP

@testset "Bounds" begin
b = C.EqualTo(0)
@test_deprecated length(b)
@test length(b) == 1
end

@testset "Values" begin
x =
C.LinearValue(SP.sparse([5.0, 0, 6.0, 0])) +
Expand Down

0 comments on commit 5253159

Please sign in to comment.