Skip to content

Commit 067ea0f

Browse files
dmartinchansuke
authored andcommitted
Fix prepend_unique_path test on Windows
1 parent 2c4828e commit 067ea0f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/env_var.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ mod tests {
187187
#[test]
188188
fn prepend_unique_path() {
189189
let mut vars = HashMap::new();
190-
vars.env("PATH", "/home/a/.cargo/bin:/home/b/.cargo/bin");
190+
vars.env(
191+
"PATH",
192+
env::join_paths(vec!["/home/a/.cargo/bin", "/home/b/.cargo/bin"].iter()).unwrap(),
193+
);
191194
let tp = Box::new(currentprocess::TestProcess {
192195
vars,
193196
..Default::default()
@@ -216,9 +219,17 @@ mod tests {
216219
envs,
217220
&[(
218221
&OsString::from("PATH"),
219-
&Some(OsString::from(
220-
"/home/a/.cargo/bin:/home/z/.cargo/bin:/home/b/.cargo/bin"
221-
))
222+
&Some(
223+
env::join_paths(
224+
vec![
225+
"/home/a/.cargo/bin",
226+
"/home/z/.cargo/bin",
227+
"/home/b/.cargo/bin"
228+
]
229+
.iter()
230+
)
231+
.unwrap()
232+
)
222233
),]
223234
);
224235
});

0 commit comments

Comments
 (0)