Skip to content

Commit b7324f4

Browse files
add tests for new trunc methods (Quarter)
1 parent f831d99 commit b7324f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/Dates/test/adjusters.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ using Dates
88
@testset "trunc" begin
99
dt = Dates.Date(2012, 12, 21)
1010
@test trunc(dt, Dates.Year) == Dates.Date(2012)
11+
@test trunc(dt, Dates.Quarter) == Dates.Date(2012, 10)
1112
@test trunc(dt, Dates.Month) == Dates.Date(2012, 12)
1213
@test trunc(dt, Dates.Day) == Dates.Date(2012, 12, 21)
1314
dt = Dates.DateTime(2012, 12, 21, 16, 30, 20, 200)
1415
@test trunc(dt, Dates.Year) == Dates.DateTime(2012)
16+
@test trunc(dt, Dates.Quarter) == Dates.DateTime(2012, 10)
1517
@test trunc(dt, Dates.Month) == Dates.DateTime(2012, 12)
1618
@test trunc(dt, Dates.Day) == Dates.DateTime(2012, 12, 21)
1719
@test trunc(dt, Dates.Hour) == Dates.DateTime(2012, 12, 21, 16)

0 commit comments

Comments
 (0)