Skip to content

Commit

Permalink
head: fix 'test_spams_newline' to check *against* newline spam
Browse files Browse the repository at this point in the history
The comment was introduced in commit 8320b1e,
the test was introduced in commit c1f518e
claiming to be about "failing GNU head tests".

However, a simple check reveals no such difference:

```console
$ echo -n a | hd
00000000  61                                                |a|
00000001
$ echo -n a | head | hd  # GNU head
00000000  61                                                |a|
00000001
$ echo -n a | cargo run -- head | hd
00000000  61                                                |a|
00000001
$ echo -n a | busybox head | hd
00000000  61                                                |a|
00000001
$
```

Looking at the GNU tests directly, it seems that there is a similar, but different test.
  • Loading branch information
BenWiederhake committed Feb 22, 2024
1 parent 69ea02d commit e50eb19
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/by-util/test_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ fn test_verbose() {
}

#[test]
#[ignore]
fn test_spams_newline() {
//this test is does not mirror what GNU does
new_ucmd!().pipe_in("a").succeeds().stdout_is("a\n");
new_ucmd!().pipe_in("a").succeeds().stdout_is("a");
}

#[test]
Expand Down

0 comments on commit e50eb19

Please sign in to comment.