|
40 | 40 | @test Int(Interval(10, 10, Inclusivity(true, true))) == 10
|
41 | 41 | @test_throws DomainError Int(Interval(10, 11, Inclusivity(true, true)))
|
42 | 42 |
|
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 |
49 | 51 | end
|
50 | 52 |
|
51 | 53 | @testset "accessors" begin
|
|
0 commit comments