Skip to content

Commit

Permalink
Merge pull request #15680 from JuliaLang/ksh/pkg
Browse files Browse the repository at this point in the history
More tests for Pkg
  • Loading branch information
kshyatt committed Mar 31, 2016
2 parents 7b51368 + 420be2c commit 76dc1d8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ temp_pkg_dir() do
@test sprint(io -> Pkg.status(io)) == "No packages installed\n"
@test !isempty(Pkg.available())

@test_throws PkgError Pkg.installed("MyFakePackage")
@test Pkg.installed("Example") == nothing

# check that versioninfo(io, true) doesn't error and produces some output
# (done here since it calls Pkg.status which might error or clone metadata)
buf = PipeBuffer()
Expand Down Expand Up @@ -53,6 +56,8 @@ temp_pkg_dir() do
end
end

Pkg.setprotocol!("")
@test Pkg.Cache.rewrite_url_to == nothing
Pkg.setprotocol!("https")
Pkg.add("Example")
@test [keys(Pkg.installed())...] == ["Example"]
Expand All @@ -75,6 +80,10 @@ temp_pkg_dir() do
@test isempty(Pkg.installed())
@test !isempty(Pkg.available("Example"))
@test !in("Example", keys(Pkg.installed()))
Pkg.rm("Example")
@test isempty(Pkg.installed())
@test !isempty(Pkg.available("Example"))
@test !in("Example", keys(Pkg.installed()))
Pkg.clone("https://github.com/JuliaLang/Example.jl.git")
@test [keys(Pkg.installed())...] == ["Example"]
Pkg.status("Example", iob)
Expand Down

0 comments on commit 76dc1d8

Please sign in to comment.