mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 09:38:57 +02:00
Path migration part 4: various tests (#13373)
# Description Part 4 of replacing std::path types with nu_path types added in https://github.com/nushell/nushell/pull/13115. This PR migrates various tests throughout the code base.
This commit is contained in:
@ -2,7 +2,6 @@ use chrono::{DateTime, Local};
|
||||
use nu_test_support::fs::{files_exist_at, Stub};
|
||||
use nu_test_support::nu;
|
||||
use nu_test_support::playground::Playground;
|
||||
use std::path::Path;
|
||||
|
||||
// Use 1 instead of 0 because 0 has a special meaning in Windows
|
||||
const TIME_ONE: filetime::FileTime = filetime::FileTime::from_unix_time(1, 0);
|
||||
@ -494,12 +493,12 @@ fn create_a_file_with_tilde() {
|
||||
Playground::setup("touch with tilde", |dirs, _| {
|
||||
let actual = nu!(cwd: dirs.test(), "touch '~tilde'");
|
||||
assert!(actual.err.is_empty());
|
||||
assert!(files_exist_at(vec![Path::new("~tilde")], dirs.test()));
|
||||
assert!(files_exist_at(&["~tilde"], dirs.test()));
|
||||
|
||||
// pass variable
|
||||
let actual = nu!(cwd: dirs.test(), "let f = '~tilde2'; touch $f");
|
||||
assert!(actual.err.is_empty());
|
||||
assert!(files_exist_at(vec![Path::new("~tilde2")], dirs.test()));
|
||||
assert!(files_exist_at(&["~tilde2"], dirs.test()));
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user