1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
|
use Test::More tests => 10; |
|
|
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 => 10; |
7 |
|
|
8 |
BEGIN { |
BEGIN { |
9 |
|
use_ok( 'WebPAC::Test' ); |
10 |
use_ok( 'WebPAC::Output::Webpacus' ); |
use_ok( 'WebPAC::Output::Webpacus' ); |
11 |
} |
} |
12 |
|
|
|
my $debug = shift @ARGV; |
|
|
|
|
|
ok(my $abs_path = abs_path($0), "abs_path"); |
|
|
$abs_path =~ s#/[^/]*$#/#; # |
|
|
diag "abs_path: $abs_path"; |
|
|
my $path = "$abs_path/sorted/"; |
|
|
|
|
13 |
ok(my $out = new WebPAC::Output::Webpacus({ |
ok(my $out = new WebPAC::Output::Webpacus({ |
14 |
path => '/data/Webpacus2/', |
path => '/data/Webpacus2/', |
15 |
database => 'test', |
database => 'test', |
16 |
clean => 1, |
clean => 1, |
17 |
debug => $debug, |
%LOG |
18 |
}), "new"); |
}), "new"); |
19 |
|
|
20 |
ok( $out->init, 'init' ); |
ok( $out->init, 'init' ); |
41 |
|
|
42 |
ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' ); |
ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' ); |
43 |
|
|
44 |
diag "path: ",$out->path; |
diag "path: ",$out->path if $debug; |
45 |
|
|
46 |
ok( $out->finish, 'finish' ); |
ok( $out->finish, 'finish' ); |
47 |
|
|