@@ -2,26 +2,59 @@ import PumasProductManager
22using Test
33
44@testset " PumasProductManager" begin
5- io = IOBuffer ()
6- PumasProductManager. list (io)
7- list = String (take! (io))
8- @test contains (list, " Pumas@2.6.1" )
5+ # NOTE: update whenever new versions are released.
6+ expected_versions = [" DeepPumas@0.8.0" , " DeepPumas@0.8.1" , " Pumas@2.6.0" , " Pumas@2.6.1" ]
7+
8+ @testset " Version listing" begin
9+ io = IOBuffer ()
10+ PumasProductManager. list (io)
11+ list = String (take! (io))
12+
13+ for each in expected_versions
14+ @test contains (list, each)
15+ end
16+ end
17+
918 try
1019 mktempdir () do dir
11- cd (dir) do
12- withenv (" JULIA_PKG_PRECOMPILE_AUTO" => " 0" ) do
13- PumasProductManager. init (" Pumas@2.6.1" , " pumas-2.6.1" )
20+ @testset " Installation" begin
21+ cd (dir) do
22+ withenv (" JULIA_PKG_PRECOMPILE_AUTO" => " 1" ) do
23+ for each in expected_versions
24+ PumasProductManager. init (each)
25+ PumasProductManager. init (each, each)
26+ end
27+ end
1428 end
15- end
16- status = readchomp (` juliaup st` )
17- @test contains (status, " Pumas@2.6.1" )
1829
19- contents = readdir (joinpath (dir, " pumas-2.6.1" ))
20- @test " Project.toml" in contents
21- @test " Manifest.toml" in contents
30+ status = readchomp (` juliaup st` )
31+ for each in expected_versions
32+ @test contains (status, each)
33+ end
34+
35+ for each in expected_versions
36+ dirs =
37+ [joinpath (DEPOT_PATH [1 ], " environments" , each), joinpath (dir, each)]
38+ for folder in dirs
39+ contents = readdir (folder)
40+ @test " Project.toml" in contents
41+ @test " Manifest.toml" in contents
42+ end
43+ end
44+
45+ for each in expected_versions
46+ product, _ = split (each, " @" ; limit = 2 )
47+ file = joinpath (@__DIR__ , " $product .jl" )
48+ channel = " +$each "
49+ cmd = ` julia $channel $file `
50+ @test contains (readchomp (cmd), " :success" )
51+ end
52+ end
2253 end
2354 finally
24- @test success (` juliaup rm Pumas@2.6.1` )
55+ for each in expected_versions
56+ @test success (` juliaup rm $each ` )
57+ end
2558 @test success (` juliaup rm PumasProductManager` )
2659 end
2760end
0 commit comments