1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
|
use Test::More tests => 16; |
|
|
use Test::Exception; |
|
|
use Cwd qw/abs_path/; |
|
|
use Data::Dump qw/dump/; |
|
|
use blib; |
|
3 |
use strict; |
use strict; |
4 |
|
use blib; |
5 |
|
|
6 |
|
use Test::More tests => 16; |
7 |
|
|
8 |
BEGIN { |
BEGIN { |
9 |
|
use_ok( 'WebPAC::Test' ); |
10 |
use_ok( 'WebPAC::Output::Sorted' ); |
use_ok( 'WebPAC::Output::Sorted' ); |
11 |
} |
} |
12 |
|
|
|
my $debug = shift @ARGV; |
|
|
|
|
|
ok(my $abs_path = abs_path($0), "abs_path"); |
|
|
$abs_path =~ s#/[^/]*$#/#; # |
|
|
diag "abs_path: $abs_path"; |
|
13 |
my $path = "$abs_path/sorted/"; |
my $path = "$abs_path/sorted/"; |
14 |
|
|
15 |
ok(my $out = new WebPAC::Output::Sorted({ |
ok(my $out = new WebPAC::Output::Sorted({ |
16 |
path => $path, |
path => $path, |
17 |
database => 'test', |
database => 'test', |
18 |
clean => 1, |
clean => 1, |
19 |
debug => $debug, |
%LOG |
20 |
}), "new"); |
}), "new"); |
21 |
|
|
22 |
ok( $out->init, 'init' ); |
ok( $out->init, 'init' ); |
45 |
|
|
46 |
ok( -e $out->path, "created $path" ); |
ok( -e $out->path, "created $path" ); |
47 |
|
|
48 |
diag $out->path," eq ",$path; |
diag $out->path," eq ",$path if $debug; |
49 |
cmp_ok( $out->path, 'eq', $path, 'path' ); |
cmp_ok( $out->path, 'eq', $path, 'path' ); |
50 |
|
|
51 |
ok( $out->finish, 'finish' ); |
ok( $out->finish, 'finish' ); |