From 9e2653423925623ab1405e6e39ca8aa6c7627e13 Mon Sep 17 00:00:00 2001 From: Rayhan Faizel Date: Wed, 12 Jul 2023 23:24:26 +0530 Subject: [PATCH] tests/ls: Test overflowing decimal and octal values of --width --- tests/by-util/test_ls.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 2eef6912162..15ded8e6b22 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -670,6 +670,23 @@ fn test_ls_width() { .stdout_only("test-width-1 test-width-3\ntest-width-2 test-width-4\n"); } + for option in [ + "-w 100000000000000", + "-w=100000000000000", + "--width=100000000000000", + "--width 100000000000000", + "-w 07777777777777777777", + "-w=07777777777777777777", + "--width=07777777777777777777", + "--width 07777777777777777777", + ] { + scene + .ucmd() + .args(&option.split(' ').collect::>()) + .arg("-C") + .succeeds() + .stdout_only("test-width-1 test-width-2 test-width-3 test-width-4\n"); + } scene .ucmd() .arg("-w=bad")