Skip to content

Commit

Permalink
Merge pull request JuliaLang#37528 from JuliaLang/jq/dtroundfix
Browse files Browse the repository at this point in the history
Use a fixed DateTime in rounding tests instead of now()
  • Loading branch information
quinnj committed Sep 11, 2020
2 parents 3db0493 + 6f1f8cb commit 7ecd1f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/Dates/test/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ end
end

@testset "Rouding DateTime to Date" begin
now_ = now()
now_ = DateTime(2020, 9, 1, 13)
for p in (Year, Month, Day)
for r in (RoundUp, RoundDown)
@test round(Date, now_, p, r) == round(Date(now_), p, r)
end
@test round(Date, now_, p) == round(Date, now_, p, RoundUp)
@test round(Date, now_, p) == round(Date, now_, p, RoundNearestTiesUp)
@test floor(Date, now_, p) == round(Date, now_, p, RoundDown)
@test ceil(Date, now_, p) == round(Date, now_, p, RoundUp)
end
Expand Down

0 comments on commit 7ecd1f9

Please sign in to comment.