Correction bug multiple dots mkdir and touch (#8486)

This commit is contained in:
Thomas Coratger
2023-04-05 19:22:56 +02:00
committed by GitHub
parent 1134c2f16c
commit 01e5ba01f6
3 changed files with 84 additions and 2 deletions

View File

@ -122,3 +122,42 @@ fn not_create_file_if_it_not_exists() {
assert!(!path.exists());
})
}
#[test]
fn creates_file_three_dots() {
Playground::setup("create_test_1", |dirs, _sandbox| {
nu!(
cwd: dirs.test(),
"touch file..."
);
let path = dirs.test().join("file...");
assert!(path.exists());
})
}
#[test]
fn creates_file_four_dots() {
Playground::setup("create_test_1", |dirs, _sandbox| {
nu!(
cwd: dirs.test(),
"touch file...."
);
let path = dirs.test().join("file....");
assert!(path.exists());
})
}
#[test]
fn creates_file_four_dots_quotation_marks() {
Playground::setup("create_test_1", |dirs, _sandbox| {
nu!(
cwd: dirs.test(),
"touch 'file....'"
);
let path = dirs.test().join("file....");
assert!(path.exists());
})
}