Skip to content

Commit 0147234

Browse files
committed
Add tests for Dates
1 parent 6d2d2ca commit 0147234

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/dates.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@
619619
@test !isequal(Day(4), 4u"hr")
620620
@test !isequal(4u"cm", Day(4))
621621

622+
@test isequal(CompoundPeriod(), 0s)
622623
@test isequal(CompoundPeriod(Day(365), Hour(6)), 1u"yr")
623624
@test isequal(1u"yr", CompoundPeriod(Day(365), Hour(6)))
624625
@test !isequal(CompoundPeriod(), -0.0u"s") # !isequal(0.0, -0.0)
@@ -629,6 +630,12 @@
629630
@test !isequal(CompoundPeriod(Year(1)), 1u"yr")
630631
@test !isequal(CompoundPeriod(Month(12)), 1u"yr")
631632

633+
# hash
634+
@test_broken hash(Second(2)) === hash(2.0s)
635+
@test_broken hash(72hr) === hash(Day(3))
636+
@test_broken hash(CompoundPeriod()) === hash(0s)
637+
@test_broken hash(CompoundPeriod(Hour(6))) === hash(6hr)
638+
632639
# <
633640
@test Second(1) < 1001u"ms"
634641
@test 3u"minute" < Minute(4)

0 commit comments

Comments
 (0)