Skip to content
Browse files

updated tests

  • Loading branch information...
1 parent 1399b60 commit ecc866763fa81983b40eb6079832001c021d86f1 @barbie committed Aug 21, 2011
Showing with 21 additions and 11 deletions.
  1. +7 −7 t/50logging.t
  2. +6 −2 t/56writes.t
  3. +8 −2 t/CTWS_Testing.pm
  4. BIN t/expected.zip
View
14 t/50logging.t
@@ -26,9 +26,9 @@ unlink('50logging.log') if(-f '50logging.log');
my @log = do { open FILE, '<', '50logging.log'; <FILE> };
chomp @log;
- is(scalar(@log),13, 'log written');
- like($log[11], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Hello!, 'line 1 of log');
- like($log[12], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Goodbye!, 'line 2 of log');
+ is(scalar(@log),14, 'log written');
+ like($log[12], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Hello!, 'line 1 of log');
+ like($log[13], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Goodbye!, 'line 2 of log');
}
{
@@ -44,10 +44,10 @@ unlink('50logging.log') if(-f '50logging.log');
my @log = do { open FILE, '<', '50logging.log'; <FILE> };
chomp @log;
- is(scalar(@log),25, 'log extended');
- like($log[11], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Hello!, 'line 1 of log');
- like($log[12], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Goodbye!, 'line 2 of log');
- like($log[24], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Back Again!, 'line 3 of log');
+ is(scalar(@log),27, 'log extended');
+ like($log[12], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Hello!, 'line 1 of log');
+ like($log[13], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Goodbye!, 'line 2 of log');
+ like($log[26], qr!\d{4}/\d\d/\d\d \d\d:\d\d:\d\d Back Again!, 'line 3 of log');
}
{
View
8 t/56writes.t
@@ -23,7 +23,7 @@ my $CHECK_DOMAIN = 'www.google.com';
my $UPDATE_ARCHIVE = ($ARGV[0] && $ARGV[0] eq '--update-archive') ? 1 : 0;
-use Test::More tests => 267;
+use Test::More tests => 270;
use Test::Differences;
use File::Slurp qw( slurp );
use Archive::Zip;
@@ -105,7 +105,11 @@ ok( CTWS_Testing::cleanDir($obj), 'directory cleaned' );
{
my $store1 = 't/data/cpanstats-test.json';
- $page->storage_read($store1);
+ my ($testers,$lastid) = $page->storage_read($store1);
+
+ is($lastid,182,'got lastid');
+ is($testers->{"Paul Schinder (SCHINDER)"}{'first'},199908,'got testers first');
+ is($testers->{"Paul Schinder (SCHINDER)"}{'last'}, 199909,'got testers last');
my @versions = sort {versioncmp($b,$a)} keys %{$page->{perls}};
$page->{versions} = \@versions;
View
10 t/CTWS_Testing.pm
@@ -101,14 +101,20 @@ sub saveFiles {
__DATA__
[MASTER]
+mainstore=t/_TMPDIR/cpanstats.json
+leadstore=t/_TMPDIR/leaderboard.json
+monthstore=t/_TMPDIR/cpanstats-%s.json
+
database=t/_DBDIR/test.db
address=t/data/addresses.txt
templates=templates
-mainstore=t/_TMPDIR/cpanstats.json
-leadstore=t/_TMPDIR/leaderboard.json
+builder=t/_TMPDIR/log-parser.txt
missing=t/data/missing-in-action.txt
mailrc=t/data/01mailrc.txt
+#logfile=t/_TMPDIR/cpanstats-test.log
+#logclean=0
+
[CPANSTATS]
driver=SQLite
database=t/_DBDIR/test.db
View
BIN t/expected.zip
Binary file not shown.

0 comments on commit ecc8667

Please sign in to comment.
Something went wrong with that request. Please try again.