mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +00:00
18c39daed7
The read_line function appends to the given buffer which is never cleared. This leads to lines being duplicated.
33 lines
782 B
Rust
33 lines
782 B
Rust
use crate::common::util::*;
|
|
|
|
#[test]
|
|
fn test_default_80_column_wrap() {
|
|
new_ucmd!()
|
|
.arg("lorem_ipsum.txt")
|
|
.run()
|
|
.stdout_is_fixture("lorem_ipsum_80_column.expected");
|
|
}
|
|
|
|
#[test]
|
|
fn test_40_column_hard_cutoff() {
|
|
new_ucmd!()
|
|
.args(&["-w", "40", "lorem_ipsum.txt"])
|
|
.run()
|
|
.stdout_is_fixture("lorem_ipsum_40_column_hard.expected");
|
|
}
|
|
|
|
#[test]
|
|
fn test_40_column_word_boundary() {
|
|
new_ucmd!()
|
|
.args(&["-s", "-w", "40", "lorem_ipsum.txt"])
|
|
.run()
|
|
.stdout_is_fixture("lorem_ipsum_40_column_word.expected");
|
|
}
|
|
|
|
#[test]
|
|
fn test_default_warp_with_newlines() {
|
|
new_ucmd!()
|
|
.arg("lorem_ipsum_new_line.txt")
|
|
.run()
|
|
.stdout_is_fixture("lorem_ipsum_new_line_80_column.expected");
|
|
}
|