-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
486e55e
commit 37d6809
Showing
3 changed files
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// run-pass | ||
// rustc-env:MY_VAR=tadam | ||
// compile-flags: --env MY_VAR=123abc -Zunstable-options | ||
|
||
// This test ensures that variables provided with `--env` take precedence over | ||
// variables from environment. | ||
fn main() { | ||
assert_eq!(env!("MY_VAR"), "123abc"); | ||
} |
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,5 @@ | ||
// compile-flags: --env FOO=123abc -Zunstable-options | ||
// run-pass | ||
fn main() { | ||
assert_eq!(env!("FOO"), "123abc"); | ||
} |
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,7 @@ | ||
// run-pass | ||
// rustc-env:MY_ENV=/ | ||
// Ensures that variables not defined through `--env` are still available. | ||
|
||
fn main() { | ||
assert!(!env!("MY_ENV").is_empty()); | ||
} |