Skip to content

Commit 99900f2

Browse files
committed
Improve coverage
1 parent 9eb445e commit 99900f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/interval.jl

+8-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@
4040
@test Int(Interval(10, 10, Inclusivity(true, true))) == 10
4141
@test_throws DomainError Int(Interval(10, 11, Inclusivity(true, true)))
4242

43-
dt = Date(2013, 2, 13)
44-
@test_throws DomainError Date(Interval(dt, dt, Inclusivity(false, false)))
45-
@test_throws DomainError Date(Interval(dt, dt, Inclusivity(false, true)))
46-
@test_throws DomainError Date(Interval(dt, dt, Inclusivity(true, false)))
47-
@test Date(Interval(dt, dt, Inclusivity(true, true))) == dt
48-
@test_throws DomainError Date(Interval(dt, dt + Day(1), Inclusivity(true, true)))
43+
for T in (Date, DateTime)
44+
dt = T(2013, 2, 13)
45+
@test_throws DomainError T(Interval(dt, dt, Inclusivity(false, false)))
46+
@test_throws DomainError T(Interval(dt, dt, Inclusivity(false, true)))
47+
@test_throws DomainError T(Interval(dt, dt, Inclusivity(true, false)))
48+
@test T(Interval(dt, dt, Inclusivity(true, true))) == dt
49+
@test_throws DomainError T(Interval(dt, dt + Day(1), Inclusivity(true, true)))
50+
end
4951
end
5052

5153
@testset "accessors" begin

0 commit comments

Comments
 (0)