Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from dextorious/pull-request/5b9cb07e
Browse files Browse the repository at this point in the history
Add a test for using user-defined structs in output_func
  • Loading branch information
ChrisRackauckas committed Jul 11, 2017
2 parents 700332a + 5b9cb07 commit b93d9e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/monte.jl
Expand Up @@ -89,3 +89,11 @@ prob2 = MonteCarloProblem(prob,prob_func=prob_func,output_func=output_func,reduc
sim2 = solve(prob2,Tsit5(),num_monte=100,batch_size=20)
@test sim2.converged == false
@test mean(sim.u) sim2.u/100

immutable SomeUserType end
output_func = function (sol,i)
SomeUserType()
end
prob2 = MonteCarloProblem(prob,prob_func=prob_func,output_func=output_func)
sim2 = solve(prob2,Tsit5(),num_monte=2)
@test !sim2.converged && typeof(sim2.u) == Vector{SomeUserType}

0 comments on commit b93d9e0

Please sign in to comment.