diff --git a/test/integration_dates.jl b/test/integration_dates.jl new file mode 100644 index 00000000..b8c300ee --- /dev/null +++ b/test/integration_dates.jl @@ -0,0 +1,15 @@ +using Plots, Test, Dates + +@testset "Limits" begin + y=[1.0*i*i for i in 1:10] + x=[Date(2019,11,i) for i in 1:10] + + rx=[x[3],x[5]] + + ref_ylims = (y[begin], y[end]) + ref_xlims = (x[1].instant.periods.value, x[end].instant.periods.value) + p = plot(x,y, widen = false) + vspan!(p, rx, label="", alpha=0.2) + @test Plots.ylims(p) == ref_ylims + @test Plots.xlims(p) == ref_xlims +end # testset diff --git a/test/runtests.jl b/test/runtests.jl index 5190f709..4e4ba79c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -16,6 +16,7 @@ include("test_axis_letter.jl") include("test_recipes.jl") include("test_hdf5plots.jl") include("test_pgfplotsx.jl") +include("integration_dates.jl") reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...)