add tests

This commit is contained in:
Simon Christ 2020-09-17 10:12:21 +02:00
parent c81fe1ea76
commit 099817e083
2 changed files with 16 additions and 0 deletions

15
test/integration_dates.jl Normal file
View File

@ -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

View File

@ -16,6 +16,7 @@ include("test_axis_letter.jl")
include("test_recipes.jl") include("test_recipes.jl")
include("test_hdf5plots.jl") include("test_hdf5plots.jl")
include("test_pgfplotsx.jl") include("test_pgfplotsx.jl")
include("integration_dates.jl")
reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...) reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...)