mirror of
https://github.com/nushell/nushell.git
synced 2025-02-17 19:11:26 +01:00
Adds a test case for changing drives using drive letter in Windows (#2022)
* added test case to test check switching drives using drive letter in windows * modified test case to not use config, assert file exists
This commit is contained in:
parent
bce6f5a3e6
commit
e3e1e6f81b
@ -432,3 +432,27 @@ fn valuesystem_path_not_found() {
|
|||||||
assert!(actual.err.contains("No such path exists"));
|
assert!(actual.err.contains("No such path exists"));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
#[test]
|
||||||
|
fn test_change_windows_drive() {
|
||||||
|
Playground::setup("cd_test_20", |dirs, sandbox| {
|
||||||
|
sandbox.mkdir("test_folder");
|
||||||
|
|
||||||
|
let _actual = nu!(
|
||||||
|
cwd: dirs.test(),
|
||||||
|
r#"
|
||||||
|
subst Z: test_folder
|
||||||
|
Z:
|
||||||
|
echo "some text" | save test_file.txt
|
||||||
|
cd ~
|
||||||
|
subst Z: /d
|
||||||
|
"#
|
||||||
|
);
|
||||||
|
assert!(dirs
|
||||||
|
.test()
|
||||||
|
.join("test_folder")
|
||||||
|
.join("test_file.txt")
|
||||||
|
.exists());
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user