Skip to content

Commit

Permalink
Add unit test for get_project_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaxen committed Oct 19, 2023
1 parent fcb78b0 commit 3978cb2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
21 changes: 19 additions & 2 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,26 @@ end
project = joinpath(@__DIR__, "deps", "Project.toml")

deps, dep_section = CompatHelper.get_project_deps(project; include_jll=true)
@test length(deps) == 2
@test length(deps) == 4
@test issetequal(keys(dep_section), deps)
for (k, s) in pairs(dep_section)
if k.package.name ["Bex_jll", "Skix"]
@test s == "weakdeps"
else
@test s == "deps"
end
end

deps, dep_section = CompatHelper.get_project_deps(project; include_jll=false)
@test length(deps) == 1
@test length(deps) == 2
@test issetequal(keys(dep_section), deps)
for (k, s) in pairs(dep_section)
if k.package.name == "Skix"
@test s == "weakdeps"
else
@test s == "deps"
end
end
end

@testset "clone_all_registries" begin
Expand Down
9 changes: 9 additions & 0 deletions test/deps/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ Foobar_jll = "6ca821de-e512-569d-89d9-0b16ce691416"
Baz = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[weakdeps]
Bex_jll = "3db6da90-6ed3-11ee-0779-f549c8e3e90d"
Skix = "3db6da90-6ed3-11ee-0779-f549c8e3e90d"

[extensions]
Ext = ["Bex_jll", "Skix"]

[compat]
Foobar_jll = "1"
Baz = "1"
Bex_jll = "1"
Skix = "1"
julia = "1.6"
6 changes: 4 additions & 2 deletions test/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
"GITHUB_REPOSITORY" => "CompatHelper.jl", "GITHUB_TOKEN" => "token"
) do
prs = CompatHelper.main()
@test length(prs) == 1
@test length(prs) == 2
@test prs[1] isa GitHub.PullRequest
@test prs[2] isa GitHub.PullRequest
end
end
end
Expand Down Expand Up @@ -96,8 +97,9 @@
) do
delete!(ENV, "GITHUB_REPOSITORY")
prs = CompatHelper.main()
@test length(prs) == 1
@test length(prs) == 2
@test prs[1] isa GitLab.MergeRequest
@test prs[2] isa GitLab.MergeRequest
end
end
end
Expand Down

0 comments on commit 3978cb2

Please sign in to comment.