1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!/usr/bin/env perl
# test-showtable.t
unshift(@INC,'../blib/lib') if -d '../blib/lib';
unshift(@INC,'t') if -d 't';
use Data::ShowTable;
require 'Test-Setup.pl';
sub start_tests($);
sub run_test($&);
$script = '';
foreach $dir ('blib', '../blib') {
if (-d $dir && -f "$dir/script/showtable") {
$script = "$dir/script";
last;
}
}
if ($ENV{AUTOPKGTEST_TMP} && -f '/usr/bin/showtable') {
$script = '/usr/bin';
}
if ($script eq '') {
die "Cannot find path to local 'showtable'\n";
}
$testdir = '';
foreach $dir ('t', '../t') {
if (-d $dir && -f "$dir/testdates.txt") {
$testdir = "$dir";
last;
}
}
if ($testdir eq '') {
die "Cannot find path to test directory.\n";
}
start_tests 1;
# Test negative widths
run_test 1, sub {
system("$script/showtable -d' ' $testdir/testdates.txt");
};
|