Skip to content

Commit 7359b7a

Browse files
authored
Merge pull request #79 from maxkapur/version-number-prereleases
Use trailing dash (e.g. `v"1.4-"`) to compare minor version numbers
2 parents 5adff7b + a28a9af commit 7359b7a

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/TestEnv.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module TestEnv
22

3-
@static if VERSION < v"1.1"
3+
@static if VERSION < v"1.1-"
44
include("julia-1.0/TestEnv.jl")
5-
elseif VERSION < v"1.2"
5+
elseif VERSION < v"1.2-"
66
include("julia-1.1/TestEnv.jl")
7-
elseif VERSION < v"1.3"
7+
elseif VERSION < v"1.3-"
88
include("julia-1.2/TestEnv.jl")
9-
elseif VERSION < v"1.4"
9+
elseif VERSION < v"1.4-"
1010
include("julia-1.3/TestEnv.jl")
11-
elseif VERSION < v"1.7"
11+
elseif VERSION < v"1.7-"
1212
include("julia-1.4/TestEnv.jl")
13-
elseif VERSION < v"1.8"
13+
elseif VERSION < v"1.8-"
1414
include("julia-1.7/TestEnv.jl")
15-
elseif VERSION < v"1.9"
15+
elseif VERSION < v"1.9-"
1616
include("julia-1.8/TestEnv.jl")
1717
else
1818
include("julia-1.9/TestEnv.jl")

test/activate_do.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
orig_project = Base.active_project()
88

9-
if VERSION >= v"1.4"
9+
if VERSION >= v"1.4-"
1010
direct_deps() = [v.name for (_,v) in Pkg.dependencies() if v.is_direct_dep]
1111
crc_deps = TestEnv.activate(direct_deps, "ChainRulesCore")
1212
@test "ChainRulesCore" crc_deps
@@ -20,7 +20,7 @@
2020

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

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

3636
orig_project = Base.active_project()
@@ -42,7 +42,7 @@
4242
@test isdefined(@__MODULE__, :FFTW)
4343

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

4848
orig_project = Base.active_project()

test/activate_set.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
mktempdir() do p
3131
Pkg.activate(p)
3232

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

3636
orig_project_toml_path = Base.active_project()
@@ -49,7 +49,7 @@
4949
finally
5050
Pkg.activate(orig_project_toml_path)
5151
end
52-
elseif VERSION >= v"1.2"
52+
elseif VERSION >= v"1.2-"
5353
Pkg.add(PackageSpec(name="ConstraintSolver", version="0.6.10"))
5454

5555
orig_project_toml_path = Base.active_project()
@@ -71,7 +71,7 @@
7171
end
7272
end
7373

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

0 commit comments

Comments
 (0)