Skip to content

Commit

Permalink
add tests for new trunc methods (Quarter)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSoderlind authored Nov 2, 2020
1 parent f831d99 commit b7324f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stdlib/Dates/test/adjusters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ using Dates
@testset "trunc" begin
dt = Dates.Date(2012, 12, 21)
@test trunc(dt, Dates.Year) == Dates.Date(2012)
@test trunc(dt, Dates.Quarter) == Dates.Date(2012, 10)
@test trunc(dt, Dates.Month) == Dates.Date(2012, 12)
@test trunc(dt, Dates.Day) == Dates.Date(2012, 12, 21)
dt = Dates.DateTime(2012, 12, 21, 16, 30, 20, 200)
@test trunc(dt, Dates.Year) == Dates.DateTime(2012)
@test trunc(dt, Dates.Quarter) == Dates.DateTime(2012, 10)
@test trunc(dt, Dates.Month) == Dates.DateTime(2012, 12)
@test trunc(dt, Dates.Day) == Dates.DateTime(2012, 12, 21)
@test trunc(dt, Dates.Hour) == Dates.DateTime(2012, 12, 21, 16)
Expand Down

0 comments on commit b7324f4

Please sign in to comment.