Skip to content

Commit

Permalink
Fix test_deps_compat for Project.toml without deps table (#38)
Browse files Browse the repository at this point in the history
To run `test_deps_compat` by default in Aqua 0.5 (#36), it should work
Project.toml file without `deps`.
  • Loading branch information
tkf committed Sep 8, 2020
1 parent 32055d6 commit f159a77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/deps_compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function _analyze_deps_compat_2(pkg::PkgId, root_project_path, prj)

deps = get(prj, "deps", nothing)
if deps === nothing
# Should it pass?
return LazyTestResult(label, "`$root_project_path` does not have `deps`", false)
return LazyTestResult(label, "`$root_project_path` does not have `deps`", true)
end
compat = get(prj, "compat", nothing)
if compat === nothing
Expand Down
7 changes: 3 additions & 4 deletions test/test_deps_compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ const DictSA = Dict{String,Any}
"compat" => DictSA("julia" => "1", "PkgA" => "1.0"),
),
) true
end
@testset "failure" begin
@testset "does not have `deps`" begin
# Not sure if it should fail or passs:
t = _analyze_deps_compat_2(pkg, root_project_path, DictSA())
@test t false
@test t true
@test occursin("does not have `deps`", string(t))
end

end
@testset "failure" begin
@testset "does not have `compat`" begin
t = _analyze_deps_compat_2(
pkg,
Expand Down

0 comments on commit f159a77

Please sign in to comment.