We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2fe739f commit e7ca1afCopy full SHA for e7ca1af
tests/testsuite/cargo_env_config.rs
@@ -239,3 +239,32 @@ fn env_applied_to_target_info_discovery_rustc() {
239
.with_stderr_contains("MAIN ENV_TEST:from-env")
240
.run();
241
}
242
+
243
+#[cargo_test]
244
+fn env_reset() {
245
+ let p = project()
246
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
247
+ .file(
248
+ "src/main.rs",
249
+ r#"
250
+ use std::env;
251
+ fn main() {
252
+ println!( "{}", env!("ENV_TEST") );
253
+ }
254
+ "#,
255
+ )
256
257
+ ".cargo/config.toml",
258
259
+ [env]
260
+ ENV_TEST = "from-config"
261
262
263
+ .build();
264
265
+ p.cargo("run").with_stdout_contains("from-config").run();
266
+ p.cargo("run")
267
+ .env("ENV_TEST", "from-env")
268
+ .with_stdout_contains("from-env")
269
+ .run();
270
+}
0 commit comments