also print clearing the environment entirely
This commit is contained in:
parent
3a28887623
commit
53a29e0e60
3 changed files with 44 additions and 12 deletions
|
@ -560,6 +560,29 @@ fn debug_print() {
|
|||
"FOO": None,
|
||||
}},
|
||||
}},
|
||||
{PIDFD}}}"#
|
||||
)
|
||||
);
|
||||
|
||||
let mut command_with_cleared_env = Command::new("boring-name");
|
||||
command_with_cleared_env.env_clear().env("BAR", "val").env_remove("FOO");
|
||||
assert_eq!(format!("{command_with_cleared_env:?}"), r#"env -i BAR="val" "boring-name""#);
|
||||
assert_eq!(
|
||||
format!("{command_with_cleared_env:#?}"),
|
||||
format!(
|
||||
r#"Command {{
|
||||
program: "boring-name",
|
||||
args: [
|
||||
"boring-name",
|
||||
],
|
||||
env: CommandEnv {{
|
||||
clear: true,
|
||||
vars: {{
|
||||
"BAR": Some(
|
||||
"val",
|
||||
),
|
||||
}},
|
||||
}},
|
||||
{PIDFD}}}"#
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue