-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get_env for Win32, @pierrec's get_config_dir and get_home_dir
- Loading branch information
Showing
5 changed files
with
123 additions
and
21 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
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
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,17 @@ | ||
module std::os::env @test; | ||
|
||
fn void! set_get_unset() | ||
{ | ||
const NAME = "C3_TEST_ENVVAR"; | ||
const VALUE = "foobar"; | ||
|
||
env::set_var(NAME, VALUE); | ||
String v = env::get_var(NAME)!; | ||
assert(v == VALUE, "got %s; want %s", v, VALUE); | ||
|
||
env::clear_var(NAME); | ||
if (try env::get_var(NAME)) | ||
{ | ||
assert(false, "environment variable should no longer exist"); | ||
} | ||
} |