1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-11 01:42:17 +02:00

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.
This commit is contained in:
Paul Eggert
2023-11-16 10:12:55 -08:00
parent 77201c506f
commit 0ed9d1823a
4 changed files with 4 additions and 33 deletions

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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))

View File

@@ -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")
{