Skip to content

Commit 6130a33

Browse files
committed
expr: fix crash for test_long_input on OpenBSD
Signed-off-by: Laurent Cheylus <[email protected]>
1 parent 0fabf82 commit 6130a33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/by-util/test_expr.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,17 @@ fn test_eager_evaluation() {
582582
#[test]
583583
fn test_long_input() {
584584
// Giving expr an arbitrary long expression should succeed rather than end with a segfault due to a stack overflow.
585-
#[cfg(not(windows))]
585+
#[cfg(all(not(windows), not(target_os = "openbsd")))]
586586
const MAX_NUMBER: usize = 40000;
587-
#[cfg(not(windows))]
587+
#[cfg(all(not(windows), not(target_os = "openbsd")))]
588588
const RESULT: &str = "800020000\n";
589589

590+
// On OpenBSD, crash with default MAX_NUMBER
591+
#[cfg(target_os = "openbsd")]
592+
const MAX_NUMBER: usize = 10000;
593+
#[cfg(target_os = "openbsd")]
594+
const RESULT: &str = "50005000\n";
595+
590596
// On windows there is 8192 characters input limit
591597
#[cfg(windows)]
592598
const MAX_NUMBER: usize = 1300; // 7993 characters (with spaces)

0 commit comments

Comments
 (0)