1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
|
|
3 |
use Test::More tests => 2; |
use Test::More tests => 3; |
4 |
use File::Slurp; |
use File::Slurp; |
5 |
use Data::Dump qw(dump); |
use Data::Dump qw(dump); |
6 |
|
use File::Temp qw/ tempfile tempdir /; |
7 |
|
|
8 |
use lib '/srv/Sack/lib'; |
use lib '/srv/Sack/lib'; |
9 |
|
|
11 |
use_ok( 'Sack::Server::Gnuplot' ); |
use_ok( 'Sack::Server::Gnuplot' ); |
12 |
} |
} |
13 |
|
|
14 |
my @x = qw( |
my $out = { |
15 |
2009-11-22 |
'date,test1' => { qw( |
16 |
2009-11-08 |
2009-01-01 1 |
17 |
2009-11-02 |
2009-02-01 3 |
18 |
2009-10-15 |
2009-03-01 2 |
19 |
); |
2009-04-01 4 |
20 |
|
|
21 |
ok( my $path = Sack::Server::Gnuplot::date( \@x, [ 0 .. $#x ] ), 'date' ); |
)}, |
22 |
|
'date,test2+' => { qw( |
23 |
|
2009-03-01 5 |
24 |
|
2009-06-01 1 |
25 |
|
2009-09-01 4 |
26 |
|
)}, |
27 |
|
}; |
28 |
|
|
29 |
|
diag dump($out); |
30 |
|
|
31 |
|
ok( my $path = Sack::Server::Gnuplot::date( $out ), 'date' ); |
32 |
ok( -e $path, "$path exists" ); |
ok( -e $path, "$path exists" ); |