Skip to content
This repository was archived by the owner on Jun 14, 2020. It is now read-only.

Commit 11f3bff

Browse files
authored
Fix Module scoping and add test. (#74)
* Fix Module scoping and add test. * Add compat * Remove unneeded test.
1 parent 38befcb commit 11f3bff

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/LinQuadOptInterface.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ macro LinQuadOptimizerBase(inner_model_type=Any)
231231
qconstraint_primal_solution::Vector{Float64}
232232
qconstraint_dual_solution::Vector{Float64}
233233

234-
constraint_names::Dict{CI, String}
235-
constraint_names_rev::Dict{String, Set{CI}}
234+
constraint_names::Dict{LinQuadOptInterface.CI, String}
235+
constraint_names_rev::Dict{String, Set{LinQuadOptInterface.CI}}
236236

237237
objective_constant::Float64
238238

test/runtests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ const MOIT = MathOptInterface.Test
77
const MOIU = MathOptInterface.Utilities
88
const LQOI = LinQuadOptInterface
99

10+
# Test that using LinQuadOptInterface passes without error. We have to do this
11+
# here because types can't be created in testsets. If it can be defined without
12+
# error, we're okay. This is most likely to error if fields are added to
13+
# @LinQuadOptimizerBase without proper module prefixes.
14+
using Compat # For Nothing on v0.6
15+
mutable struct OptimizerTest <: LinQuadOptInterface.LinQuadOptimizer
16+
LinQuadOptInterface.@LinQuadOptimizerBase
17+
OptimizerTest() = new()
18+
end
19+
1020
@testset "LinQuadOptInterface" begin
1121
solver = LQOI.MockLinQuadOptimizer()
1222

0 commit comments

Comments
 (0)