]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tests: remove duplicate uses of 'my' in Perl
authorCollin Funk <collin.funk1@gmail.com>
Mon, 20 Jan 2025 05:15:35 +0000 (21:15 -0800)
committerPádraig Brady <P@draigBrady.com>
Mon, 20 Jan 2025 15:45:03 +0000 (15:45 +0000)
* 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.

tests/env/env-S.pl
tests/factor/factor.pl
tests/misc/fold.pl

index 48268b41c581b2665440f4eca62a543a4dc0d70e..2d12c1843e4998051c993e859d69640fdf25bb43 100755 (executable)
@@ -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 =
index 55397f6514ce01804bf58ec56b9e824a8a088e4e..c3056dc67db008b68e85fe5fff3d7c9848478317 100755 (executable)
@@ -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)
index 0981ec9630779cc37b3a6523d54b897d508e15c5..877322e0a71676f8a2d1dc8b3734d76041d839f1 100755 (executable)
@@ -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;