Skip to content

Commit

Permalink
fix test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jan 23, 2025
1 parent bbf4616 commit 830ecdc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/apps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ isolate(loaded_depot=true) do
sep = Sys.iswindows() ? ';' : ':'
Pkg.Apps.develop(path=joinpath(@__DIR__, "test_packages", "Rot13.jl"))
current_path = ENV["PATH"]
exename = Sys.iswindows() ? "rot13.bat" : "rot13"
withenv("PATH" => string(joinpath(first(DEPOT_PATH), "bin"), sep, current_path)) do
@test contains(Sys.which("rot13"), first(DEPOT_PATH))
@test read(`rot13 test`, String) == "grfg\n"
@test contains(Sys.which("$exename"), first(DEPOT_PATH))
@test read(`$exename test`, String) == "grfg\n"
Pkg.Apps.rm("Rot13")
@test Sys.which("rot13") == nothing
@test Sys.which(exename) == nothing
end
end

Expand All @@ -24,13 +25,13 @@ isolate(loaded_depot=true) do
sep = Sys.iswindows() ? ';' : ':'
path = git_init_package(tmpdir, joinpath(@__DIR__, "test_packages", "Rot13.jl"))
Pkg.Apps.add(path=path)

exename = Sys.iswindows() ? "rot13.bat" : "rot13"
current_path = ENV["PATH"]
withenv("PATH" => string(joinpath(first(DEPOT_PATH), "bin"), sep, current_path)) do
@test contains(Sys.which("rot13"), first(DEPOT_PATH))
@test read(`rot13 test`, String) == "grfg\n"
@test contains(Sys.which(exename), first(DEPOT_PATH))
@test read(`$exename test`, String) == "grfg\n"
Pkg.Apps.rm("Rot13")
@test Sys.which("rot13") == nothing
@test Sys.which(exename) == nothing
end
end
end
Expand Down

0 comments on commit 830ecdc

Please sign in to comment.