Skip to content

Commit

Permalink
Include location info of Invalid Project.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrobinson251 committed Oct 7, 2024
1 parent e1f9c3e commit 1d031b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
#####

function parse_project(dir)
bad_project = (; name="Invalid Project.toml", uuid=UUID(UInt128(0)), licenses_in_project=String[])
bad_project = (; name="Invalid Project.toml at $dir", uuid=UUID(UInt128(0)), licenses_in_project=String[])
project_path = joinpath(dir, "Project.toml")
if !isfile(project_path)
project_path = joinpath(dir, "JuliaProject.toml")
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ PackageAnalyzer.CATCH_EXCEPTIONS[] = false
end

@testset "`parse_project`" begin
bad_project = (; name="Invalid Project.toml", uuid=UUID(UInt128(0)), licenses_in_project=String[])
bad_project(dir) = (; name="Invalid Project.toml at $dir", uuid=UUID(UInt128(0)), licenses_in_project=String[])
# malformatted TOML file
@test parse_project("missingquote") == bad_project
@test parse_project("missingquote") == bad_project("missingquote")

# bad UUID
@test parse_project("baduuid") == bad_project
@test parse_project("baduuid") == bad_project("baduuid")

# non-existent folder
@test parse_project("rstratarstra") == bad_project
@test parse_project("rstratarstra") == bad_project("rstratarstra")

# proper Project.toml
this_project = (; name = "PackageAnalyzer", uuid = PACKAGE_ANALYZER_UUID, licenses_in_project = String[])
Expand Down

0 comments on commit 1d031b9

Please sign in to comment.