From ab2cc2f17abadcb7afd0da213eab6093c439cbda Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 4 Jun 2024 22:26:22 +0200 Subject: [PATCH] cksum base64: update the GNU test to manage our output --- .../cspell.dictionaries/workspace.wordlist.txt | 3 +++ src/uucore/src/lib/features/checksum.rs | 2 +- util/gnu-patches/tests_cksum_base64.patch | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 util/gnu-patches/tests_cksum_base64.patch diff --git a/.vscode/cspell.dictionaries/workspace.wordlist.txt b/.vscode/cspell.dictionaries/workspace.wordlist.txt index ce4822f1e..ee34a3811 100644 --- a/.vscode/cspell.dictionaries/workspace.wordlist.txt +++ b/.vscode/cspell.dictionaries/workspace.wordlist.txt @@ -336,3 +336,6 @@ uutils # * function names getcwd + +# * other +algs diff --git a/src/uucore/src/lib/features/checksum.rs b/src/uucore/src/lib/features/checksum.rs index 4691c9132..03ec74107 100644 --- a/src/uucore/src/lib/features/checksum.rs +++ b/src/uucore/src/lib/features/checksum.rs @@ -2,7 +2,7 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore anotherfile invalidchecksum regexes +// spell-checker:ignore anotherfile invalidchecksum regexes JWZG use data_encoding::BASE64; use os_display::Quotable; diff --git a/util/gnu-patches/tests_cksum_base64.patch b/util/gnu-patches/tests_cksum_base64.patch new file mode 100644 index 000000000..2a8ed0af4 --- /dev/null +++ b/util/gnu-patches/tests_cksum_base64.patch @@ -0,0 +1,15 @@ +diff --git a/tests/cksum/cksum-base64.pl b/tests/cksum/cksum-base64.pl +index a037a1628..c6d87d447 100755 +--- a/tests/cksum/cksum-base64.pl ++++ b/tests/cksum/cksum-base64.pl +@@ -91,8 +91,8 @@ my $prog = 'cksum'; + my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); + + # Ensure hash names from cksum --help match those in @pairs above. +-my $help_algs = join ' ', map { m{^ ([[:alpha:]]\S+)} } +- grep { m{^ ([[:alpha:]]\S+)} } split ('\n', `cksum --help`); ++my $help_algs = join ' ', map { m{^\s*-\s*([[:alpha:]]\S+):} ? $1 : () } ++ grep { m{^\s*-\s*([[:alpha:]]\S+):} } split ('\n', `cksum --help`); + my $test_algs = join ' ', map {$_->[0]} @pairs; + $help_algs eq $test_algs or die "$help_algs not equal to\n$test_algs"; +