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

split: tests overflow

This commit is contained in:
zhitkoff 2023-09-06 14:02:08 -04:00
parent 4fd598e4d5
commit 1669a92694

View file

@ -2,7 +2,7 @@
// //
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase fghij klmno pqrst uvwxyz fivelines twohundredfortyonebytes onehundredlines nbbbb dxen // spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase fghij klmno pqrst uvwxyz fivelines twohundredfortyonebytes onehundredlines nbbbb dxen ncccc
use crate::common::util::{AtPath, TestScenario}; use crate::common::util::{AtPath, TestScenario};
use rand::{thread_rng, Rng, SeedableRng}; use rand::{thread_rng, Rng, SeedableRng};
@ -796,6 +796,7 @@ fn test_number_kth_of_n() {
.args(&["-e", "--number=99/100", "asciilowercase.txt"]) .args(&["-e", "--number=99/100", "asciilowercase.txt"])
.succeeds() .succeeds()
.stdout_only(""); .stdout_only("");
#[cfg(target_pointer_width = "64")]
new_ucmd!() new_ucmd!()
.args(&[ .args(&[
"--number=r/9223372036854775807/18446744073709551615", "--number=r/9223372036854775807/18446744073709551615",
@ -811,6 +812,7 @@ fn test_number_kth_of_n() {
.args(&["--number=10/5", "asciilowercase.txt"]) .args(&["--number=10/5", "asciilowercase.txt"])
.fails() .fails()
.stderr_contains("split: invalid chunk number: 10"); .stderr_contains("split: invalid chunk number: 10");
#[cfg(target_pointer_width = "64")]
new_ucmd!() new_ucmd!()
.args(&[ .args(&[
"--number=9223372036854775807/18446744073709551616", "--number=9223372036854775807/18446744073709551616",
@ -834,6 +836,7 @@ fn test_number_kth_of_n_round_robin() {
.args(&["-e", "--number", "r/7/7", "fivelines.txt"]) .args(&["-e", "--number", "r/7/7", "fivelines.txt"])
.succeeds() .succeeds()
.stdout_only(""); .stdout_only("");
#[cfg(target_pointer_width = "64")]
new_ucmd!() new_ucmd!()
.args(&[ .args(&[
"--number", "--number",
@ -842,6 +845,7 @@ fn test_number_kth_of_n_round_robin() {
]) ])
.succeeds() .succeeds()
.stdout_only(""); .stdout_only("");
#[cfg(target_pointer_width = "64")]
new_ucmd!() new_ucmd!()
.args(&[ .args(&[
"--number", "--number",
@ -1018,6 +1022,7 @@ fn test_line_bytes() {
#[test] #[test]
fn test_line_bytes_overflow() { fn test_line_bytes_overflow() {
#[cfg(target_pointer_width = "64")]
let (at, mut ucmd) = at_and_ucmd!(); let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["-C", "18446744073709551616", "letters.txt"]) ucmd.args(&["-C", "18446744073709551616", "letters.txt"])
.succeeds(); .succeeds();