Skip to content

Commit

Permalink
cksum base64: update the GNU test to manage our output
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Jun 4, 2024
1 parent bfcad4b commit e7466a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 16 additions & 0 deletions util/gnu-patches/tests_cksum_base64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cspell:disable-next-line: algs
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";

0 comments on commit e7466a1

Please sign in to comment.