Skip to content

Commit 67a1546

Browse files
committed
fix: handle both string and function types for KNITRO.amplexe in tests
1 parent 97a3484 commit 67a1546

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/C_wrapper.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,15 @@ end
10031003
end
10041004

10051005
@testset "knitroampl" begin
1006-
@test occursin(
1007-
"AMPL/Knitro",
1008-
sprint(io -> run(pipeline(`$(KNITRO.amplexe) -v`; stdout=io))),
1009-
)
1006+
if KNITRO.amplexe isa String
1007+
@test occursin(
1008+
"AMPL/Knitro",
1009+
sprint(io -> run(pipeline(`$(KNITRO.amplexe) -v`; stdout=io))),
1010+
)
1011+
else
1012+
@test occursin(
1013+
"AMPL/Knitro",
1014+
sprint(io -> run(pipeline(`$(KNITRO.amplexe()) -v`; stdout=io))),
1015+
)
1016+
end
10101017
end

0 commit comments

Comments
 (0)