From cd450f49d45ccb005dc77ad161bd9e5ae2b527e3 Mon Sep 17 00:00:00 2001 From: Thatcher Chamberlin Date: Sun, 6 Dec 2020 13:26:26 -0500 Subject: [PATCH] Added tests for plots where xlims are Dates and DateTimes --- test/integration_dates.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/integration_dates.jl b/test/integration_dates.jl index 6a5756c7..85ed3da6 100644 --- a/test/integration_dates.jl +++ b/test/integration_dates.jl @@ -14,3 +14,19 @@ using Plots, Test, Dates @test Plots.ylims(p) == ref_ylims @test Plots.xlims(p) == ref_xlims end # testset + +@testset "Date xlims" begin + y=[1.0*i*i for i in 1:10] + x=[Date(2019,11,i) for i in 1:10] + span = (Date(2019,10,31), Date(2019,11,11)) + + p = plot(x,y, xlims=span, widen = false) +end # testset + +@testset "DateTime xlims" begin + y=[1.0*i*i for i in 1:10] + x=[DateTime(2019,11,i,11) for i in 1:10] + span = (DateTime(2019,10,31,11,59,59), DateTime(2019,11,11,12,01,15)) + + p = plot(x,y, xlims=span, widen = false) +end # testset