summaryrefslogtreecommitdiff
path: root/tests/misc/tail.pl
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
commit71cd8e3a743046573744123777061b64881bf372 (patch)
tree82522befe647f4fff186a5630cad0cad33f8ef53 /tests/misc/tail.pl
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-upstream.tar.gz
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'tests/misc/tail.pl')
-rwxr-xr-xtests/misc/tail.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/misc/tail.pl b/tests/misc/tail.pl
index 6798eb05..7f113aaf 100755
--- a/tests/misc/tail.pl
+++ b/tests/misc/tail.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# Test tail.
-# Copyright (C) 2008-2014 Free Software Foundation, Inc.
+# Copyright (C) 2008-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
use strict;
my $prog = 'tail';
-my $normalize_filename = {ERR_SUBST => 's/^$prog: .*?:/$prog: -:/'};
+my $normalize_strerror = "s/': .*/'/";
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -59,7 +59,7 @@ my @tv = (
"$prog: cannot open '+cl' for reading: No such file or directory\n"],
['err-2', '-cl', '', '', 1,
- "$prog: l: invalid number of bytes\n"],
+ "$prog: invalid number of bytes: 'l'\n", $normalize_strerror],
['err-3', '+2cz', '', '', 1,
"$prog: cannot open '+2cz' for reading: No such file or directory\n"],
@@ -72,9 +72,10 @@ my @tv = (
# the diagnostic: 'tail: 99999999999999999999: invalid number of bytes'
# on all systems... probably, for now, maybe.
['err-5', '-c99999999999999999999', '', '', 1,
- "$prog: 99999999999999999999: invalid number of bytes\n"],
+ "$prog: invalid number of bytes: '99999999999999999999'\n",
+ $normalize_strerror],
['err-6', '-c --', '', '', 1,
- "$prog: -: invalid number of bytes\n", $normalize_filename],
+ "$prog: invalid number of bytes: '-'\n", $normalize_strerror],
# Same as -n 10
['minus-1', '-', '', '', 0],
@@ -106,10 +107,10 @@ my @Tests;
foreach my $t (@tv)
{
- my ($test_name, $flags, $in, $exp, $ret, $err_msg) = @$t;
+ my ($test_name, $flags, $in, $exp, $ret, $err_msg, $err_sub) = @$t;
my $e = [$test_name, $flags, {IN=>$in}, {OUT=>$exp}];
$ret
- and push @$e, {EXIT=>$ret}, {ERR=>$err_msg};
+ and push @$e, {EXIT=>$ret}, {ERR=>$err_msg}, {ERR_SUBST=>$err_sub};
$test_name =~ /^(obs-plus-|minus-)/
and push @$e, {ENV=>'_POSIX2_VERSION=199209'};