Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Oct 7, 2024
1 parent 74e4ed0 commit 92e10d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/test/bmi_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
@test BMI.get_end_time(model) 3.16224e7
BMI.update(model)
@test BMI.get_current_time(model) dt0 atol = 5e-3
# cannot go back in time
@test_throws ErrorException BMI.update_until(model, dt0 / 2.0)
@test BMI.get_current_time(model) dt0 atol = 5e-3
BMI.update_until(model, 86400.0)
@test BMI.get_current_time(model) == 86400.0
# cannot go back in time
@test_throws ErrorException BMI.update_until(model, 3600.0)
@test BMI.get_current_time(model) == 86400.0
end

@testitem "fixed timestepping" begin
Expand Down
2 changes: 1 addition & 1 deletion core/test/control_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ end

t_switch = Ribasim.datetime_since(record.time[2], p.starttime)
flow_table = DataFrame(Ribasim.flow_table(model))
@test all(filter(:time => time -> time <= t_switch, flow_table).flow_rate .> 0)
@test all(filter(:time => time -> time <= t_switch, flow_table).flow_rate .> -1e-12)
@test all(
isapprox.(
filter(:time => time -> time > t_switch, flow_table).flow_rate,
Expand Down

0 comments on commit 92e10d6

Please sign in to comment.