X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FGruntmaster-Data.t;h=0c77a410276fb3e0ce7b2111c08d6cac55a7aabe;hb=8ab124f5b4b8d8c871c3bf2c3fb11eb17f61d2f6;hp=38c2330fcf3219501264cf9289571e4c27d86290;hpb=cab36bc417a7d8723aeef55269adc8f2425d8e99;p=gruntmaster-data.git diff --git a/t/Gruntmaster-Data.t b/t/Gruntmaster-Data.t index 38c2330..0c77a41 100644 --- a/t/Gruntmaster-Data.t +++ b/t/Gruntmaster-Data.t @@ -8,7 +8,7 @@ use Test::More; BEGIN { eval { - Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1; + dbinit 'dbi:Pg:dbname=gmtest'; 1; } or plan skip_all => 'Cannot connect to test database. Create it by running createdb gmtest before running this test. '. "Error: $@"; plan tests => 33; } @@ -101,11 +101,13 @@ is_deeply $x->{results}, [], 'job_entry results'; $x = job_entry 7; ok !defined $x->{result}, 'job_entry 7 has NULL result'; +open_problem qw/fc fca MGV/, contest_entry('fc')->{start} + 300; + $x = standings 'fc'; -is_deeply $x, { - problems => [[fca => 'FC problem A']], - st => [ - {rank => 1, user => 'MGV', user_name => undef, score => 50, scores => [50]}, - {rank => 2, user => 'nobody', user_name => undef, score => 40, scores => [40]}, - ] -}, 'standings fc'; + +is_deeply $x, [ + {rank => 1, user => 'MGV', user_name => undef, score => 80, scores => [80]}, + {rank => 2, user => 'nobody', user_name => undef, score => 40, scores => [40]}, +], 'standings fc'; + +db->delete('opens', {contest => 'fc', problem => 'fca', owner => 'MGV'});