From ee4ee881be4fcd1ab1f4ecd8b01a43b786e6cdc3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 7 Nov 2026 11:59:57 +0100 Subject: [PATCH] tests: basenc: ensure --base58 decodes input of more than 1024 digits Reported at https://github.com/uutils/coreutils/issues/15776 * tests/basenc/large-input.sh: Add a base58 round trip. Link: https://github.com/coreutils/coreutils/pull/440 --- tests/basenc/large-input.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/basenc/large-input.sh b/tests/basenc/large-input.sh index d90f8bf67..53ef73cf1 100755 --- a/tests/basenc/large-input.sh +++ b/tests/basenc/large-input.sh @@ -24,4 +24,11 @@ truncate -s20MiB file.zeros || framework_failure_ test $(basenc --base58 file.zeros | wc -c) = 21247462 || fail=1 +# Ensure base58 input of more than 1024 digits is decoded as one number. +seq 300 > nums || framework_failure_ +basenc --base58 -w0 nums > nums.b58 || fail=1 +test $(wc -c < nums.b58) -gt 1024 || framework_failure_ +basenc --base58 -d nums.b58 > back || fail=1 +compare nums back || fail=1 + Exit $fail