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

split: fixing tests for parse_size_max()

This commit is contained in:
zhitkoff 2023-09-05 18:38:22 -04:00
parent 2a0b4f8837
commit a0a9ee6491

View file

@ -608,14 +608,6 @@ fn test_split_invalid_bytes_size() {
.fails() .fails()
.code_is(1) .code_is(1)
.stderr_only("split: invalid number of bytes: '1024R'\n"); .stderr_only("split: invalid number of bytes: '1024R'\n");
#[cfg(not(target_pointer_width = "128"))]
new_ucmd!()
.args(&["-b", "1Y"])
.fails()
.code_is(1)
.stderr_only(
"split: invalid number of bytes: '1Y': Value too large for defined data type\n",
);
#[cfg(target_pointer_width = "32")] #[cfg(target_pointer_width = "32")]
{ {
let sizes = ["1000G", "10T"]; let sizes = ["1000G", "10T"];
@ -625,6 +617,18 @@ fn test_split_invalid_bytes_size() {
} }
} }
#[test]
fn test_split_overflow_bytes_size() {
#[cfg(not(target_pointer_width = "128"))]
let (at, mut ucmd) = at_and_ucmd!();
let name = "test_split_overflow_bytes_size";
RandomFile::new(&at, name).add_bytes(1000);
ucmd.args(&["-b", "1Y", name]).succeeds();
let glob = Glob::new(&at, ".", r"x[[:alpha:]][[:alpha:]]$");
assert_eq!(glob.count(), 1);
assert_eq!(glob.collate(), at.read_bytes(name));
}
#[test] #[test]
fn test_split_chunks_num_chunks_oversized_32() { fn test_split_chunks_num_chunks_oversized_32() {
#[cfg(target_pointer_width = "32")] #[cfg(target_pointer_width = "32")]