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:
HiranmayaGundu 2020-06-22 00:32:58 +05:30 committed by GitHub
parent bce6f5a3e6
commit e3e1e6f81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -432,3 +432,27 @@ fn valuesystem_path_not_found() {
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());
})
}