Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use trailing dash (e.g. v"1.4-") to compare minor version numbers #79

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/TestEnv.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module TestEnv

@static if VERSION < v"1.1"
@static if VERSION < v"1.1-"
include("julia-1.0/TestEnv.jl")
elseif VERSION < v"1.2"
elseif VERSION < v"1.2-"
include("julia-1.1/TestEnv.jl")
elseif VERSION < v"1.3"
elseif VERSION < v"1.3-"
include("julia-1.2/TestEnv.jl")
elseif VERSION < v"1.4"
elseif VERSION < v"1.4-"
include("julia-1.3/TestEnv.jl")
elseif VERSION < v"1.7"
elseif VERSION < v"1.7-"
include("julia-1.4/TestEnv.jl")
elseif VERSION < v"1.8"
elseif VERSION < v"1.8-"
include("julia-1.7/TestEnv.jl")
elseif VERSION < v"1.9"
elseif VERSION < v"1.9-"
include("julia-1.8/TestEnv.jl")
else
include("julia-1.9/TestEnv.jl")
Expand Down
8 changes: 4 additions & 4 deletions test/activate_do.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

orig_project = Base.active_project()

if VERSION >= v"1.4"
if VERSION >= v"1.4-"
direct_deps() = [v.name for (_,v) in Pkg.dependencies() if v.is_direct_dep]
crc_deps = TestEnv.activate(direct_deps, "ChainRulesCore")
@test "ChainRulesCore" ∈ crc_deps
Expand All @@ -20,7 +20,7 @@

# We use endswith here because on MacOS GitHub runners for some reasons the paths are slightly different
# We also skip on Julia 1.2 and 1.3 on Windows because it is using 8 character shortened paths in one case
if !((v"1.2" <= VERSION < v"1.4") && Sys.iswindows())
if !((v"1.2-" <= VERSION < v"1.4-") && Sys.iswindows())
@test endswith(Base.active_project(), orig_project)
end
end
Expand All @@ -30,7 +30,7 @@
mktempdir() do p
Pkg.activate(p)

if VERSION >= v"1.4"
if VERSION >= v"1.4-"
Pkg.add(PackageSpec(name="MCMCDiagnosticTools", version="0.1.0"))

orig_project = Base.active_project()
Expand All @@ -42,7 +42,7 @@
@test isdefined(@__MODULE__, :FFTW)

@test endswith(Base.active_project(), orig_project)
elseif VERSION >= v"1.2"
elseif VERSION >= v"1.2-"
Pkg.add(PackageSpec(name="ConstraintSolver", version="0.6.10"))

orig_project = Base.active_project()
Expand Down
6 changes: 3 additions & 3 deletions test/activate_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
mktempdir() do p
Pkg.activate(p)

if VERSION >= v"1.4"
if VERSION >= v"1.4-"
Pkg.add(PackageSpec(name="YAXArrays", version="0.1.3"))

orig_project_toml_path = Base.active_project()
Expand All @@ -49,7 +49,7 @@
finally
Pkg.activate(orig_project_toml_path)
end
elseif VERSION >= v"1.2"
elseif VERSION >= v"1.2-"
Pkg.add(PackageSpec(name="ConstraintSolver", version="0.6.10"))

orig_project_toml_path = Base.active_project()
Expand All @@ -71,7 +71,7 @@
end
end

if VERSION >= v"1.4"
if VERSION >= v"1.4-"
# https://github.com/JuliaTesting/TestEnv.jl/issues/26
@test isdefined(TestEnv, :isfixed)
end
Expand Down