From: Collin Funk Date: Mon, 20 Jan 2025 05:15:35 +0000 (-0800) Subject: maint: tests: remove duplicate uses of 'my' in Perl X-Git-Tag: v9.7~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91d5a512365726b89868b7113d9df5cbe6cab270;p=thirdparty%2Fcoreutils.git maint: tests: remove duplicate uses of 'my' in Perl * tests/env/env-S.pl (cf): Remove uses of 'my' after the variable has been declared. * tests/factor/factor.pl (t): Likewise. * tests/misc/fold.pl (prog): Remove duplicate assignment. --- diff --git a/tests/env/env-S.pl b/tests/env/env-S.pl index 48268b41c5..2d12c1843e 100755 --- a/tests/env/env-S.pl +++ b/tests/env/env-S.pl @@ -35,12 +35,12 @@ $env = $1; my $cf = '__CF_USER_TEXT_ENCODING'; exists $ENV{$cf} and $env .= " -u$cf"; # Likewise for these Cygwin env vars -my $cf = 'SYSTEMROOT'; +$cf = 'SYSTEMROOT'; exists $ENV{$cf} and $env .= " -u$cf"; -my $cf = 'WINDIR'; +$cf = 'WINDIR'; exists $ENV{$cf} and $env .= " -u$cf"; # Likewise for these GNU/Hurd env vars -my $cf = 'LD_ORIGIN_PATH'; +$cf = 'LD_ORIGIN_PATH'; exists $ENV{$cf} and $env .= " -u$cf"; my @Tests = diff --git a/tests/factor/factor.pl b/tests/factor/factor.pl index 55397f6514..c3056dc67d 100755 --- a/tests/factor/factor.pl +++ b/tests/factor/factor.pl @@ -102,7 +102,7 @@ Test: foreach $t (@Tests) { (my $arg1 = $t->[1]) =~ s| *\+?||; # strip '+' - (my $arg1 = $arg1) =~ s| *-[^ ]+ *||; # strip option + ($arg1 = $arg1) =~ s| *-[^ ]+ *||; # strip option # Don't fiddle with expected OUT string if there's a nonzero exit status. foreach my $e (@$t) diff --git a/tests/misc/fold.pl b/tests/misc/fold.pl index 0981ec9630..877322e0a7 100755 --- a/tests/misc/fold.pl +++ b/tests/misc/fold.pl @@ -47,6 +47,5 @@ my @Tests = my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -my $prog = 'fold'; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); exit $fail;