summaryrefslogtreecommitdiff
path: root/tests/misc/uniq
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/uniq')
-rwxr-xr-xtests/misc/uniq21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/misc/uniq b/tests/misc/uniq
index 1c85735a2..0350864c0 100755
--- a/tests/misc/uniq
+++ b/tests/misc/uniq
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Test for a subtle, system-and-locale-dependent bug in uniq.
+#!/usr/bin/perl
+# Test uniq.
# Copyright (C) 2008 Free Software Foundation, Inc.
@@ -16,16 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-case $LOCALE_FR in
-''|none) echo "$0: skipping this test -- no appropriate locale" 1>&2; exit 77;;
-esac
-
-: ${srcdir=.}
-. $top_srcdir/tests/require-perl
-
-me=`echo $0|sed 's,.*/,,'`
-exec $PERL -w -I$top_srcdir/tests -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
-require 5.003;
use strict;
my $prog = 'uniq';
@@ -90,6 +80,11 @@ sub add_z_variants($)
# I've only ever triggered the problem in a non-C locale.
my $locale = $ENV{LOCALE_FR};
+if (! defined $locale || $locale eq 'none')
+ {
+ warn "$prog: skipping this test -- no appropriate locale\n";
+ exit 77;
+ }
# See if isblank returns true for nbsp.
my $x = `env printf '\xa0'| LC_ALL=$locale tr '[:blank:]' x`;
@@ -100,6 +95,7 @@ my $schar_exp = $x eq 'x' ? " y z\n" : $in;
my @Tests =
(
+ # Test for a subtle, system-and-locale-dependent bug in uniq.
['schar', '-f1', {IN => $in}, {OUT => $schar_exp},
{ENV => "LC_ALL=$locale"}],
['1', '', {IN=>''}, {OUT=>''}],
@@ -217,4 +213,3 @@ my $verbose = $ENV{VERBOSE};
my $fail = run_tests ($prog, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
-EOF