timeseries/t/1parse.t

39 lines
733 B
Perl
Raw Permalink Normal View History

######################### We start with some black magic to print on failure.
BEGIN { $| = 1; print "1..4\n"; }
END {print "not ok 1\n" unless $loaded;}
use TimeSeries;
$loaded = 1;
print "ok 1\n";
######################### End of black magic.
my $test;
$test = 2;
my $ts = TimeSeries->new();
if (defined($ts)) {
print "ok $test\n";
} else {
print "not ok $test\n";
}
$ts->legend("value");
$test = 3;
$ts->add_timestring('2003-07-06T17:52:33', 5);
if ($ts->{data}[0][0] == 1057506753) {
print "ok $test\n";
} else {
print "not ok $test\n";
}
$test = 4;
$ts->add_timestring('06/Jul/2003:17:52:34 +0200', 5);
if ($ts->{data}[1][0] == 1057506754) {
print "ok $test\n";
} else {
print "not ok $test\n";
}