Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Nov 13, 2023
1 parent a956d47 commit c095771
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/test_deps_compat.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
module TestDepsCompat

include("preamble.jl")
using Aqua: find_missing_deps_compat
using Aqua: find_missing_deps_compat, has_julia_compat

const DictSA = Dict{String,Any}

@testset "has_julia_compat" begin
@test has_julia_compat(DictSA("compat" => DictSA("julia" => "1")))
@test has_julia_compat(DictSA("compat" => DictSA("julia" => "1.0")))
@test has_julia_compat(DictSA("compat" => DictSA("julia" => "1.6")))
@test has_julia_compat(
DictSA(
"deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
"compat" => DictSA("julia" => "1", "PkgA" => "1.0"),
),
)

@test !has_julia_compat(DictSA())
@test !has_julia_compat(DictSA("compat" => DictSA()))
@test !has_julia_compat(DictSA("compat" => DictSA("PkgA" => "1.0")))
@test !has_julia_compat(
DictSA(
"deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
"compat" => DictSA("PkgA" => "1.0"),
),
)
end

@testset "find_missing_deps_compat" begin
@testset "pass" begin
result = find_missing_deps_compat(
DictSA("deps" => DictSA(), "compat" => DictSA("julia" => "1")),
"deps",
)
@test isempty(result)

result = find_missing_deps_compat(
DictSA(
"deps" => DictSA("PkgA" => "229717a1-0d13-4dfb-ba8f-049672e31205"),
Expand Down

0 comments on commit c095771

Please sign in to comment.