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 => 35;
+ plan tests => 33;
}
note 'Setting up test database';
$x = contest_entry 'fc';
cmp_deeply $x, {id => 'fc', name => 'Finished contest', start => ignore, stop => ignore, owner => 'MGV', owner_name => undef, finished => bool (1), started => bool (1), description => undef}, 'contest_entry fc';
-$x = contest_full 'fc';
-ok exists $x->{editorial}, 'contest_full fc has editorial';
-
ok contest_has_problem('rc', 'rca'), 'contest rc has problem rca';
ok contest_has_problem('rc', 'arc'), 'contest rc does not have problem arc';
$x = job_entry 7;
ok !defined $x->{result}, 'job_entry 7 has NULL result';
-$x = job_full 1;
-ok exists $x->{source}, 'job_full has source';
+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'});