Skip to content

Commit 1e511f8

Browse files
author
pitx-perf
committed
same for issolverstepclock and iscontinuous
1 parent ae78a5c commit 1e511f8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/clock.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ isclock(c) = isa(c, TimeDomain) && @match c begin
4545
_ => false
4646
end
4747

48-
issolverstepclock(c) = @match c begin
48+
issolverstepclock(c) = isa(c, TimeDomain) && @match c begin
4949
SolverStepClock() => true
5050
_ => false
5151
end
5252

53-
iscontinuous(c) = @match c begin
53+
iscontinuous(c) = isa(c, TimeDomain) && @match c begin
5454
ContinuousClock() => true
5555
_ => false
5656
end

test/clock.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ using MLStyle: @match
2424
@test !issolverstepclock(PeriodicClock(; dt = 1.0))
2525
@test !issolverstepclock(Continuous())
2626
@test issolverstepclock(SolverStepClock())
27+
@test !issolverstepclock(nothing)
2728

2829
@test !iscontinuous(PeriodicClock(; dt = 1.0))
2930
@test iscontinuous(Continuous())
3031
@test !iscontinuous(SolverStepClock())
32+
@test !iscontinuous(nothing)
3133

3234
@test is_discrete_time_domain(PeriodicClock(; dt = 1.0))
3335
@test !is_discrete_time_domain(Continuous())

0 commit comments

Comments
 (0)