Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Nov 6, 2023
1 parent d2c640f commit 4510fa4
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions test/test_deps_compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const DictSA = Dict{String,Any}
"deps",
)
@test isempty(result)

result = find_missing_deps_compat(
DictSA(
"deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
Expand All @@ -20,19 +21,32 @@ const DictSA = Dict{String,Any}
"deps",
)
@test isempty(result)
@testset "does not have `deps`" begin
result = find_missing_deps_compat(DictSA(), "deps")

@testset "does not specify `compat` for julia, but check only `extras`" begin
result = find_missing_deps_compat(
DictSA(
"extras" =>
DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
"compat" => DictSA("PkgA" => "1.0"),
),
"extras",
)
@test isempty(result)
end
end
@testset "failure" begin
@testset "does not have `deps`" begin
result = find_missing_deps_compat(DictSA(), "deps")
@test "julia" in [pkg.name for pkg in result]
end

@testset "does not have `compat`" begin
result = find_missing_deps_compat(
DictSA("deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205")),
"deps",
)
@test length(result) == 1
@test [pkg.name for pkg in result] == ["PkgA"]
@test length(result) == 2
@test [pkg.name for pkg in result] == ["PkgA", "julia"]
end

@testset "does not specify `compat` for PkgA" begin
Expand Down Expand Up @@ -75,6 +89,18 @@ const DictSA = Dict{String,Any}
@test length(result) == 1
@test [pkg.name for pkg in result] == ["LinearAlgebra"]
end

@testset "does not specify `compat` for julia" begin
result = find_missing_deps_compat(
DictSA(
"deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
"compat" => DictSA("PkgA" => "1.0"),
),
"deps",
)
@test length(result) == 1
@test [pkg.name for pkg in result] == ["julia"]
end
end
end

Expand Down

0 comments on commit 4510fa4

Please sign in to comment.