From 6130a334f22ade5455f4fa6c9cc289986f7fef29 Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Sat, 8 Nov 2025 17:15:35 +0100 Subject: [PATCH] expr: fix crash for test_long_input on OpenBSD Signed-off-by: Laurent Cheylus --- tests/by-util/test_expr.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_expr.rs b/tests/by-util/test_expr.rs index 6320fe00b..adf1cd4fd 100644 --- a/tests/by-util/test_expr.rs +++ b/tests/by-util/test_expr.rs @@ -582,11 +582,17 @@ fn test_eager_evaluation() { #[test] fn test_long_input() { // Giving expr an arbitrary long expression should succeed rather than end with a segfault due to a stack overflow. - #[cfg(not(windows))] + #[cfg(all(not(windows), not(target_os = "openbsd")))] const MAX_NUMBER: usize = 40000; - #[cfg(not(windows))] + #[cfg(all(not(windows), not(target_os = "openbsd")))] const RESULT: &str = "800020000\n"; + // On OpenBSD, crash with default MAX_NUMBER + #[cfg(target_os = "openbsd")] + const MAX_NUMBER: usize = 10000; + #[cfg(target_os = "openbsd")] + const RESULT: &str = "50005000\n"; + // On windows there is 8192 characters input limit #[cfg(windows)] const MAX_NUMBER: usize = 1300; // 7993 characters (with spaces)