From 0ed9d1823a0a994d8c135f3932592f7fee97d444 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 16 Nov 2023 10:12:55 -0800 Subject: [PATCH] tests: omit inapplicable test code * tests/misc/join.pl, tests/uniq/uniq.pl: Remove test for "invalid byte, character or field list" message that is not generated. --- tests/cut/cut.pl | 2 +- tests/expr/expr.pl | 2 +- tests/misc/join.pl | 17 +---------------- tests/uniq/uniq.pl | 16 +--------------- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/tests/cut/cut.pl b/tests/cut/cut.pl index 2e019078dc..872a24ac8c 100755 --- a/tests/cut/cut.pl +++ b/tests/cut/cut.pl @@ -233,7 +233,7 @@ if ($mb_locale ne 'C') { # Duplicate each test vector, appending "-mb" to the test name and # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we - # provide coverage for the distro-added multi-byte code paths. + # provide coverage for multi-byte code paths. my @new; foreach my $t (@Tests) { diff --git a/tests/expr/expr.pl b/tests/expr/expr.pl index f4863b109d..f12f30b5f1 100755 --- a/tests/expr/expr.pl +++ b/tests/expr/expr.pl @@ -215,7 +215,7 @@ if ($mb_locale ne 'C') { # Duplicate each test vector, appending "-mb" to the test name and # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we - # provide coverage for the distro-added multi-byte code paths. + # provide coverage for multi-byte code paths. my @new; foreach my $t (@Tests) { diff --git a/tests/misc/join.pl b/tests/misc/join.pl index 4eafc273d6..514633a5d8 100755 --- a/tests/misc/join.pl +++ b/tests/misc/join.pl @@ -26,7 +26,6 @@ my $limits = getlimits (); my $prog = 'join'; my $try = "Try '$prog --help' for more information.\n"; -my $inval = "$prog: invalid byte, character or field list\n$try"; my $mb_locale; #Comment out next line to disable multibyte tests @@ -342,31 +341,17 @@ foreach my $t (@tv) push @Tests, $new_ent; } -# Add _POSIX2_VERSION=199209 to the environment of each test -# that uses an old-style option like +1. if ($mb_locale ne 'C') { # Duplicate each test vector, appending "-mb" to the test name and # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we - # provide coverage for the distro-added multi-byte code paths. + # provide coverage for multi-byte code paths. my @new; foreach my $t (@Tests) { my @new_t = @$t; my $test_name = shift @new_t; - # Depending on whether join is multi-byte-patched, - # it emits different diagnostics: - # non-MB: invalid byte or field list - # MB: invalid byte, character or field list - # Adjust the expected error output accordingly. - if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} - (@new_t)) - { - my $sub = {ERR_SUBST => 's/, character//'}; - push @new_t, $sub; - push @$t, $sub; - } #Adjust the output some error messages including test_name for mb if (grep {ref $_ eq 'HASH' && exists $_->{ERR}} (@new_t)) diff --git a/tests/uniq/uniq.pl b/tests/uniq/uniq.pl index e43cd6e3f7..f8aff5fa53 100755 --- a/tests/uniq/uniq.pl +++ b/tests/uniq/uniq.pl @@ -23,8 +23,6 @@ my $limits = getlimits (); my $prog = 'uniq'; my $try = "Try '$prog --help' for more information.\n"; -my $inval = "$prog: invalid byte, character or field list\n$try"; - # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -274,25 +272,13 @@ if ($mb_locale ne 'C') { # Duplicate each test vector, appending "-mb" to the test name and # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we - # provide coverage for the distro-added multi-byte code paths. + # provide coverage for multi-byte code paths. my @new; foreach my $t (@Tests) { my @new_t = @$t; my $test_name = shift @new_t; - # Depending on whether uniq is multi-byte-patched, - # it emits different diagnostics: - # non-MB: invalid byte or field list - # MB: invalid byte, character or field list - # Adjust the expected error output accordingly. - if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval} - (@new_t)) - { - my $sub = {ERR_SUBST => 's/, character//'}; - push @new_t, $sub; - push @$t, $sub; - } # In test #145, replace the each ‘...’ by '...'. if ($test_name =~ "145") { -- 2.47.2