-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bound calculation for zero functions + Add tests
- Loading branch information
1 parent
77b0305
commit 4d65e63
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function test_bounds() | ||
@testset "Bounds" begin | ||
let f = PBO.PBF{Symbol,Float64}(:x => 1.0, :y => -1.0) | ||
@test PBO.lowerbound(f) ≈ -1.0 | ||
@test PBO.upperbound(f) ≈ 1.0 | ||
@test all(PBO.bounds(f) .≈ (-1.0, 1.0)) | ||
end | ||
|
||
let f = zero(PBO.PBF{Symbol,Float64}) | ||
@test PBO.lowerbound(f) ≈ 0.0 | ||
@test PBO.upperbound(f) ≈ 0.0 | ||
@test all(PBO.bounds(f) .≈ (0.0, 0.0)) | ||
end | ||
end | ||
|
||
return nothing | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters