Skip to content

Commit c09d1a8

Browse files
fixed trace test
1 parent a509e54 commit c09d1a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/OptimizationEvolutionary/test/runtests.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ Random.seed!(1234)
4141
end
4242
return false
4343
end
44-
sol = solve(prob, CMAES= 40, λ = 100), callback = cb, maxiters = 100)
44+
solve(prob, CMAES= 40, λ = 100), callback = cb, maxiters = 100)
4545

46-
#test that `store_trace=true` works now. Threw ""type Array has no field value" before.
47-
solve(prob, CMAES= 40, λ = 100), store_trace = true)
48-
4946
# Test compatibility of user overload of trace!
5047
function Evolutionary.trace!(record::Dict{String, Any}, objfun, state, population, method::CMAES, options)
5148
# record fittest individual
5249
record["TESTVAL"] = state.fittest
5350
end
51+
52+
#test that `store_trace=true` works now. Threw ""type Array has no field value" before.
53+
sol = solve(prob, CMAES= 40, λ = 100), store_trace = true)
54+
5455
# Make sure that both the user's trace record value, as well as `x` are stored in the trace.
5556
@test haskey(sol.original.trace[end].metadata, "TESTVAL") && haskey(sol.original.trace[end].metadata, "x")
5657
end

0 commit comments

Comments
 (0)