From 50cfd2263e642dcb2a75f418f06ec6fb3afd1513 Mon Sep 17 00:00:00 2001 From: Alexander Plavin Date: Mon, 2 Oct 2023 09:57:26 -0400 Subject: [PATCH] support on 1.9- as well --- Project.toml | 1 + src/InverseFunctions.jl | 4 ++++ test/test_inverse.jl | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ea90178..c007d0a 100644 --- a/Project.toml +++ b/Project.toml @@ -3,6 +3,7 @@ uuid = "3587e190-3f89-42d0-90ee-14403ec27112" version = "0.1.13" [deps] +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [weakdeps] diff --git a/src/InverseFunctions.jl b/src/InverseFunctions.jl index 0c5438b..3710fbe 100644 --- a/src/InverseFunctions.jl +++ b/src/InverseFunctions.jl @@ -13,4 +13,8 @@ include("inverse.jl") include("setinverse.jl") include("test.jl") +@static if !isdefined(Base, :get_extension) + include("../ext/DatesExt.jl") +end + end # module diff --git a/test/test_inverse.jl b/test/test_inverse.jl index 3eaf976..5798127 100644 --- a/test/test_inverse.jl +++ b/test/test_inverse.jl @@ -125,7 +125,7 @@ end end end -VERSION ≥ v"1.9" && @testset "dates" begin +@testset "dates" begin InverseFunctions.test_inverse(Dates.date2epochdays, Date(2020, 1, 2); compare = ===) InverseFunctions.test_inverse(Dates.datetime2epochms, DateTime(2020, 1, 2, 12, 34, 56); compare = ===) InverseFunctions.test_inverse(Dates.epochdays2date, Int64(1234); compare = ===)