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

cat: Unrevert splice patch (#2020)

* cat: Unrevert splice patch

* cat: Add fifo test

* cat: Add tests for error cases

* cat: Add tests for character devices

* wc: Make sure we handle short splice writes

* cat: Fix tests for 1.40.0 compiler

* cat: Run rustfmt on test_cat.rs

* Run 'cargo +1.40.0 update'
This commit is contained in:
Árni Dagur 2021-04-10 20:19:53 +00:00 committed by GitHub
parent bf1944271c
commit eb4971e6f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 496 additions and 183 deletions

View file

@ -1,5 +1,33 @@
use crate::common::util::*;
#[test]
fn test_count_bytes_large_stdin() {
for &n in &[
0,
1,
42,
16 * 1024 - 7,
16 * 1024 - 1,
16 * 1024,
16 * 1024 + 1,
16 * 1024 + 3,
32 * 1024,
64 * 1024,
80 * 1024,
96 * 1024,
112 * 1024,
128 * 1024,
] {
let data = vec_of_size(n);
let expected = format!("{}\n", n);
new_ucmd!()
.args(&["-c"])
.pipe_in(data)
.succeeds()
.stdout_is_bytes(&expected.as_bytes());
}
}
#[test]
fn test_stdin_default() {
new_ucmd!()