From 183a99d53251e1da6960b5fb3c164271e272e4e7 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Fri, 14 Feb 2025 17:41:36 -0500 Subject: [PATCH] split: avoid extremely long format width in test Avoid an extremely long format width specifier in test case `test_long_lines`. The Rust compiler is planning an upcoming change to restrict the maximum width that can be specified to 65535, so this change defends against future limitations in the compiler. For more information, see . --- tests/by-util/test_split.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_split.rs b/tests/by-util/test_split.rs index 9e58cfd42..febb6895b 100644 --- a/tests/by-util/test_split.rs +++ b/tests/by-util/test_split.rs @@ -1977,9 +1977,9 @@ fn test_split_separator_same_multiple() { #[test] fn test_long_lines() { let (at, mut ucmd) = at_and_ucmd!(); - let line1 = format!("{:131070}\n", ""); - let line2 = format!("{:1}\n", ""); - let line3 = format!("{:131071}\n", ""); + let line1 = [" ".repeat(131_070), String::from("\n")].concat(); + let line2 = [" ", "\n"].concat(); + let line3 = [" ".repeat(131_071), String::from("\n")].concat(); let infile = [line1, line2, line3].concat(); ucmd.args(&["-C", "131072"]) .pipe_in(infile)