Skip to content

Commit bd844a1

Browse files
committed
Fix override_set_unset_with_path
1 parent fc156a4 commit bd844a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/cli-rustup.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -847,22 +847,27 @@ fn show_toolchain_override_not_installed() {
847847
#[test]
848848
fn override_set_unset_with_path() {
849849
setup(&|config| {
850-
let workdir = config.current_dir();
851-
let workdir = workdir.to_string_lossy();
850+
let cwd = fs::canonicalize(config.current_dir()).unwrap();
851+
let mut cwd_str = cwd.to_str().unwrap();
852+
853+
if cfg!(windows) {
854+
cwd_str = &cwd_str[4..];
855+
}
856+
852857
config.change_dir(&config.emptydir, &|| {
853858
expect_ok(
854859
config,
855-
&["rustup", "override", "set", "nightly", "--path", &workdir],
860+
&["rustup", "override", "set", "nightly", "--path", cwd_str],
856861
);
857862
});
858863
expect_ok_ex(
859864
config,
860865
&["rustup", "override", "list"],
861-
&format!("{}\tnightly-{}\n", &workdir, this_host_triple()),
866+
&format!("{}\tnightly-{}\n", cwd_str, this_host_triple()),
862867
r"",
863868
);
864869
config.change_dir(&config.emptydir, &|| {
865-
expect_ok(config, &["rustup", "override", "unset", "--path", &workdir]);
870+
expect_ok(config, &["rustup", "override", "unset", "--path", cwd_str]);
866871
});
867872
expect_ok_ex(
868873
config,

0 commit comments

Comments
 (0)