Skip to content

Commit

Permalink
Use a fixed DateTime in rounding tests instead of now()
Browse files Browse the repository at this point in the history
Using now led to inconsistent answers depending on when `now()` is; make
tests more reliable by using a fixed `DateTime`.
  • Loading branch information
quinnj committed Sep 11, 2020
1 parent 9f6d4dd commit f864197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/Dates/test/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ 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)
Expand Down

0 comments on commit f864197

Please sign in to comment.