diff --git a/test/new.jl b/test/new.jl index b067a9ada5..c9ff1c0284 100644 --- a/test/new.jl +++ b/test/new.jl @@ -817,7 +817,7 @@ end @test Pkg.dependencies()[exuuid].version == v"0.3.0" @test Pkg.dependencies()[pngjll_uuid].version == v"1.6.37+4" Pkg.add(Pkg.PackageSpec(;name="JSON", version="0.18.0"); preserve=Pkg.PRESERVE_NONE) - @test Pkg.dependencies()[exuuid].version == v"0.5.3" + @test Pkg.dependencies()[exuuid].version > v"0.3.0" @test Pkg.dependencies()[json_uuid].version == v"0.18.0" @test Pkg.dependencies()[pngjll_uuid].version > v"1.6.37+4" end diff --git a/test/pkg.jl b/test/pkg.jl index da891bd25f..2793c246e2 100644 --- a/test/pkg.jl +++ b/test/pkg.jl @@ -269,8 +269,9 @@ temp_pkg_dir() do project_path end @testset "develop / freeing" begin - Pkg.add(TEST_PKG.name) + Pkg.add(name=TEST_PKG.name, version=v"0.5.3") old_v = Pkg.dependencies()[TEST_PKG.uuid].version + @test old_v == v"0.5.3" Pkg.rm(TEST_PKG.name) mktempdir() do devdir withenv("JULIA_PKG_DEVDIR" => devdir) do @@ -299,11 +300,27 @@ temp_pkg_dir() do project_path touch("deps.jl") """ ) + exa_proj = joinpath(devdir, TEST_PKG.name, "Project.toml") + proj_str = read(exa_proj, String) + compat_onwards = split(proj_str, "[compat]")[2] + open(exa_proj, "w") do io + println(io, """ + name = "Example" + uuid = "$(TEST_PKG.uuid)" + version = "100.0.0" + + [compat] + $compat_onwards + """) + end + Pkg.resolve() + @test Pkg.dependencies()[TEST_PKG.uuid].version == v"100.0.0" Pkg.build(TEST_PKG.name) @test isfile(joinpath(devdir, TEST_PKG.name, "deps", "deps.jl")) Pkg.test(TEST_PKG.name) Pkg.free(TEST_PKG.name) - @test Pkg.dependencies()[TEST_PKG.uuid].version == old_v + @test Pkg.dependencies()[TEST_PKG.uuid].version < v"100.0.0" + @test Pkg.dependencies()[TEST_PKG.uuid].version >= old_v end end end diff --git a/test/repl.jl b/test/repl.jl index 8a44661485..b0d729dd92 100644 --- a/test/repl.jl +++ b/test/repl.jl @@ -57,9 +57,10 @@ temp_pkg_dir(;rm=false) do project_path; cd(project_path) do; tmp_pkg_path = mktempdir() pkg"activate ." - pkg"add Example@0.5" + pkg"add Example@0.5.3" @test isinstalled(TEST_PKG) v = Pkg.dependencies()[TEST_PKG.uuid].version + @test v == v"0.5.3" pkg"rm Example" pkg"add Example, Random" pkg"rm Example Random"