1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ls: fix tests for windows

This commit is contained in:
Terts Diepraam 2022-01-18 13:47:50 +01:00
parent 0a30c43bb6
commit 77229aea86

View file

@ -1995,48 +1995,42 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("--hide") .arg("--hide=*")
.arg("*")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only(""); .stdout_only("");
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=*")
.arg("*")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only(""); .stdout_only("");
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=irrelevant pattern")
.arg("irrelevant pattern")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("CONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n"); .stdout_only("CONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n");
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=README*.md")
.arg("README*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("CONTRIBUTING.md\nsome_other_file\n"); .stdout_only("CONTRIBUTING.md\nsome_other_file\n");
scene scene
.ucmd() .ucmd()
.arg("--hide") .arg("--hide=README*.md")
.arg("README*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("CONTRIBUTING.md\nsome_other_file\n"); .stdout_only("CONTRIBUTING.md\nsome_other_file\n");
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=*.md")
.arg("*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("some_other_file\n"); .stdout_only("some_other_file\n");
@ -2044,8 +2038,7 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("-a") .arg("-a")
.arg("--ignore") .arg("--ignore=*.md")
.arg("*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only(".\n..\nsome_other_file\n"); .stdout_only(".\n..\nsome_other_file\n");
@ -2053,8 +2046,7 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("-a") .arg("-a")
.arg("--hide") .arg("--hide=*.md")
.arg("*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only(".\n..\nCONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n"); .stdout_only(".\n..\nCONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n");
@ -2062,8 +2054,7 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("-A") .arg("-A")
.arg("--ignore") .arg("--ignore=*.md")
.arg("*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("some_other_file\n"); .stdout_only("some_other_file\n");
@ -2071,8 +2062,7 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("-A") .arg("-A")
.arg("--hide") .arg("--hide=*.md")
.arg("*.md")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("CONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n"); .stdout_only("CONTRIBUTING.md\nREADME.md\nREADMECAREFULLY.md\nsome_other_file\n");
@ -2080,30 +2070,24 @@ fn test_ls_ignore_hide() {
// Stacking multiple patterns // Stacking multiple patterns
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=README*")
.arg("README*") .arg("--ignore=CONTRIBUTING*")
.arg("--ignore")
.arg("CONTRIBUTING*")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("some_other_file\n"); .stdout_only("some_other_file\n");
scene scene
.ucmd() .ucmd()
.arg("--hide") .arg("--hide=README*")
.arg("README*") .arg("--ignore=CONTRIBUTING*")
.arg("--ignore")
.arg("CONTRIBUTING*")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("some_other_file\n"); .stdout_only("some_other_file\n");
scene scene
.ucmd() .ucmd()
.arg("--hide") .arg("--hide=README*")
.arg("README*") .arg("--hide=CONTRIBUTING*")
.arg("--hide")
.arg("CONTRIBUTING*")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stdout_only("some_other_file\n"); .stdout_only("some_other_file\n");
@ -2111,8 +2095,7 @@ fn test_ls_ignore_hide() {
// Invalid patterns // Invalid patterns
scene scene
.ucmd() .ucmd()
.arg("--ignore") .arg("--ignore=READ[ME")
.arg("READ[ME")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stderr_contains(&"Invalid pattern") .stderr_contains(&"Invalid pattern")
@ -2120,8 +2103,7 @@ fn test_ls_ignore_hide() {
scene scene
.ucmd() .ucmd()
.arg("--hide") .arg("--hide=READ[ME")
.arg("READ[ME")
.arg("-1") .arg("-1")
.succeeds() .succeeds()
.stderr_contains(&"Invalid pattern") .stderr_contains(&"Invalid pattern")