We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
--env
1 parent 8176ab9 commit 70f7df6Copy full SHA for 70f7df6
tests/ui/extenv/extenv-env-overload.rs
@@ -0,0 +1,8 @@
1
+// run-pass
2
+// compile-flags: --env PATH=123abc -Zunstable-options
3
+
4
+// This test ensures that variables provided with `--env` take precedence over
5
+// variables from environment.
6
+fn main() {
7
+ assert_eq!(env!("PATH"), "123abc");
8
+}
tests/ui/extenv/extenv-env.rs
@@ -0,0 +1,5 @@
+// compile-flags: --env FOO=123abc -Zunstable-options
+ assert_eq!(env!("FOO"), "123abc");
tests/ui/extenv/extenv-not-env.rs
@@ -0,0 +1,6 @@
+// Ensures that variables not defined through `--env` are stil available.
+ assert!(!env!("PATH").is_empty());
0 commit comments