1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

tsort: split edge data on any whitespace chars

Make `tsort` split on any whitespace character instead of just
whitespace within a single line. This allows edge information to be
split with the source node on one line and the target node on another.

For example, after this commit

    $ printf "a\nb\n" | tsort
    a
    b

whereas before this would print an error message.

Closes #7077
This commit is contained in:
Jeffrey Finkelstein 2025-01-04 22:51:36 -05:00
parent 5cf5acb4a2
commit f703e88e9f
2 changed files with 13 additions and 11 deletions

View file

@ -75,3 +75,11 @@ fn test_error_on_dir() {
.fails()
.stderr_contains("tsort: tsort_test_dir: read error: Is a directory");
}
#[test]
fn test_split_on_any_whitespace() {
new_ucmd!()
.pipe_in("a\nb\n")
.succeeds()
.stdout_only("a\nb\n");
}