-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move env.jl test to separate test file
- Loading branch information
Showing
3 changed files
with
33 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This file is a part of Julia. License is MIT: http://julialang.org/license | ||
|
||
@test !("f=a=k=e=n=a=m=e" ∈ keys(ENV)) | ||
|
||
# issue #10994 | ||
@test_throws ArgumentError ENV["bad\0name"] = "ok" | ||
@test_throws ArgumentError ENV["okname"] = "bad\0val" | ||
@test_throws ArgumentError Sys.set_process_title("bad\0title") | ||
|
||
withenv("bad"=>"dog") do | ||
@test_throws ArgumentError ENV["bad\0cat"] | ||
end | ||
|
||
# issue #11170 | ||
withenv("TEST"=>"nonempty") do | ||
@test ENV["TEST"] == "nonempty" | ||
end | ||
withenv("TEST"=>"") do | ||
@test ENV["TEST"] == "" | ||
end | ||
|
||
let c = collect(ENV) | ||
@test isa(c, Vector) | ||
@test length(ENV) == length(c) | ||
@test isempty(ENV) || first(ENV) in c | ||
end | ||
|
||
# test for non-existent keys | ||
key = randstring(25) | ||
@test !haskey(ENV,key) | ||
@test_throws KeyError ENV[key] | ||
@test get(ENV,key,"default") == "default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters