mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tests(ls): Test space alignment when quoting is involved on grid output
This commit is contained in:
parent
0209c90b4e
commit
147c0b6962
1 changed files with 35 additions and 0 deletions
|
@ -2950,6 +2950,41 @@ fn test_ls_quoting_and_color() {
|
|||
.stdout_only("'one two'\r\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ls_align_unquoted() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
at.touch("elf two");
|
||||
at.touch("foobar");
|
||||
at.touch("CAPS");
|
||||
at.touch("'quoted'");
|
||||
|
||||
// In TTY
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("--color")
|
||||
.terminal_simulation(true)
|
||||
.succeeds()
|
||||
.stdout_only("\"'quoted'\" CAPS 'elf two' foobar\r\n");
|
||||
// ^ ^ ^
|
||||
// space no-space space
|
||||
|
||||
// The same should happen with format columns/across
|
||||
// and shell quoting style, except for the `\r` at the end.
|
||||
for format in &["--format=column", "--format=across"] {
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("--color")
|
||||
.arg(format)
|
||||
.arg("--quoting-style=shell")
|
||||
.succeeds()
|
||||
.stdout_only("\"'quoted'\" CAPS 'elf two' foobar\n");
|
||||
// ^ ^ ^
|
||||
// space no-space space
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ls_ignore_hide() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue