*** empty log message ***
[coreutils.git] / tests / seq / basic
bloba8f6ba552d045b6d539226d7704c7f62e72aebba
1 #!/bin/sh
2 # -*- perl -*-
4 : ${PERL=perl}
5 : ${srcdir=.}
7 case "$PERL" in
8 *'missing perl')
9 echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
11 exit 77
13 esac
15 exec $PERL -w -I$srcdir/.. -MFetish -- - << \EOF
16 require 5.003;
17 use strict;
19 (my $program_name = $0) =~ s|.*/||;
21 # Turn off localisation of executable's ouput.
22 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
24 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
26 my @Tests =
28 ['onearg-1', qw(10), {OUT => [(1..10)]}],
29 ['onearg-2', qw(-1), {OUT => [qw(1 0 -1)]}],
30 ['neg-1', qw(-10 10 10), {OUT => [qw(-10 0 10)]}],
31 ['neg-2', qw(-.1 .1 .1), {OUT => [qw(-0.1 0 0.1)]}],
32 ['neg-3', qw(1 -1 0), {OUT => [qw(1 0)]}],
33 ['neg-4', qw(1 -1 -1), {OUT => [qw(1 0 -1)]}],
35 ['eq-wid-1', qw(-w 1 -1 -1), {OUT => [qw(01 00 -1)]}],
36 ['eq-wid-2', qw(-w -.1 .1 .1),{OUT => [qw(-0.1 00.0 00.1)]}],
39 # Append a newline to each entry in the OUT array.
40 my $t;
41 foreach $t (@Tests)
43 my $e;
44 foreach $e (@$t)
46 $e->{OUT} = join ("\n", @{$e->{OUT}}) . "\n"
47 if ref $e eq 'HASH' and exists $e->{OUT};
51 my $save_temps = $ENV{SAVE_TEMPS};
52 my $verbose = $ENV{VERBOSE};
54 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
55 exit $fail;
56 EOF