Skip to content

Commit

Permalink
Achieve 100% code coverage (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 20, 2024
1 parent 99d544b commit 23356fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/MathOptAI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,10 @@ end

include("utilities.jl")

for file in filter(
x -> endswith(x, ".jl"),
readdir(joinpath(@__DIR__, "predictors"); join = true),
)
include(file)
for file in readdir(joinpath(@__DIR__, "predictors"); join = true)
if endswith(file, ".jl")
include(file)
end
end

for sym in names(@__MODULE__; all = true)
Expand Down
8 changes: 8 additions & 0 deletions test/test_predictors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ function test_Scale()
return
end

function test_fallback_bound_methods()
fake_variable = "x"
l, u = MathOptAI._get_variable_bounds(fake_variable)
@test (l, u) == (-Inf, Inf)
@test MathOptAI._set_bounds_if_finite(fake_variable, l, u) === nothing
return
end

end # module

TestPredictors.runtests()

0 comments on commit 23356fc

Please sign in to comment.