make *dots* tests easier to read (#9467)

related to
- https://github.com/nushell/nushell/pull/8544

cc/ @jntrnr @ahkrr 

# Description
some of the tests in the `dots.rs` file are a bit hard to read because
some of the paths look like command calls 🤔

in an attempt to making them easier to read, in the tests of `dots.rs`,
this PR
- replaces `file .../` with `not_a_cmd.../` because it's not a call to
the `file` command
- removes the space in `not_a_cmd .../` to see it's not a command call
- adds a bit more `not a cmd` to the last tests, to be consistent with
the other tests

# User-Facing Changes
```
$nothing
```

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
-  `toolkit test`
-  `toolkit test stdlib`
This commit is contained in:
Antoine Stevan 2023-06-20 10:28:10 +02:00 committed by GitHub
parent 1be4eaeae3
commit aaa21c1619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,7 +295,7 @@ mod tests {
#[test] #[test]
fn string_with_three_ndots_and_garbage() { fn string_with_three_ndots_and_garbage() {
check_ndots_expansion(r"file .../ garbage.*[", "file .../ garbage.*["); check_ndots_expansion(r"not_a_cmd.../ garbage.*[", "not_a_cmd.../ garbage.*[");
} }
} }
@ -324,12 +324,18 @@ mod tests {
fn string_with_three_ndots_and_garbage() { fn string_with_three_ndots_and_garbage() {
// filenames can contain spaces, in these cases the ... .... etc. // filenames can contain spaces, in these cases the ... .... etc.
// that are part of a filepath should not be expanded // that are part of a filepath should not be expanded
check_ndots_expansion("not_a_cmd .../ garbage.*[", "not_a_cmd .../ garbage.*["); check_ndots_expansion("not_a_cmd.../ garbage.*[", "not_a_cmd.../ garbage.*[");
check_ndots_expansion("/not_a_cmd .../ garbage.*[", "/not_a_cmd .../ garbage.*["); check_ndots_expansion("/not_a_cmd.../ garbage.*[", "/not_a_cmd.../ garbage.*[");
check_ndots_expansion("./not_a_cmd .../ garbage.*[", "./not_a_cmd .../ garbage.*["); check_ndots_expansion("./not_a_cmd.../ garbage.*[", "./not_a_cmd.../ garbage.*[");
check_ndots_expansion("../../nac .../ garbage.*[", ".../nac .../ garbage.*["); check_ndots_expansion(
check_ndots_expansion("../../nac .../ garbage.*[...", ".../nac .../ garbage.*[..."); "../../not a cmd.../ garbage.*[",
check_ndots_expansion("../../ garbage.*[", ".../ garbage.*["); ".../not a cmd.../ garbage.*[",
);
check_ndots_expansion(
"../../not a cmd.../ garbage.*[...",
".../not a cmd.../ garbage.*[...",
);
check_ndots_expansion("../../ not a cmd garbage.*[", ".../ not a cmd garbage.*[");
} }
} }
} }