From 3535bfdc7257d734d83f843c2dcac0a76a37fbb4 Mon Sep 17 00:00:00 2001 From: David Rebbe <1187684+ic3man5@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:13:43 -0500 Subject: [PATCH] test(sort): add test for overflowing -k argument --- tests/by-util/test_sort.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/by-util/test_sort.rs b/tests/by-util/test_sort.rs index 62aa07dae..b6ce74cc8 100644 --- a/tests/by-util/test_sort.rs +++ b/tests/by-util/test_sort.rs @@ -1302,3 +1302,14 @@ fn test_same_sort_mode_twice() { fn test_args_override() { new_ucmd!().args(&["-f", "-f"]).pipe_in("foo").succeeds(); } + +#[test] +fn test_k_overflow() { + let input = "2\n1\n"; + let output = "1\n2\n"; + new_ucmd!() + .args(&["-k", "18446744073709551616"]) + .pipe_in(input) + .succeeds() + .stdout_is(output); +}