Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchor committed Dec 15, 2024
1 parent 44efaab commit 80870de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/test_simulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,17 @@ function run_basic_simulation_tests(arch)
simulation.callbacks[:tester] = Callback(capture_call_time, schedule, parameters=called_at)
run!(simulation)

@show called_at
@test all(called_at .≈ 0.0:schedule.interval:simulation.stop_time)


# Test that minimum_relative_step is running correctly
final_time = 1.0 + 1e-11
simulation = Simulation(model, Δt=1, stop_time=final_time, minimum_relative_step=1e-10)
run!(simulation)

@test simulation.model.clock.time == final_time
@test simulation.model.clock.iteration == 1

return nothing
end

Expand Down

0 comments on commit 80870de

Please sign in to comment.