-close $pipe;
-
-withdb {
- subtest 'gruntmaster-problem add' => sub {
- plan tests => 13;
- my $pb = $db->problem('pb');
- ok $pb, 'problem exists';
- is $pb->name, 'Test problem', 'name';
- is $pb->author, 'Marius Gavrilescu', 'author';
- is $pb->writer, 'Smaranda Ciubotaru', 'statement writer';
- is $pb->owner->id, 'MGV', 'owner';
- is $pb->level, 'easy', 'level';
- is $pb->generator, 'Undef', 'generator';
- is $pb->runner, 'File', 'runner';
- is $pb->judge, 'Absolute', 'judge';
- is $pb->testcnt, 3, 'test count';
- is $pb->timeout, 1, 'time limit';
- is $pb->olimit, 100, 'output limit';
- ok $db->contest_problems->find('ct', 'pb'), 'is in contest';
- }
-};
-
-is `./gruntmaster-problem get pb author`, "Marius Gavrilescu\n", 'gruntmaster-problem get';
-system './gruntmaster-problem set pb owner nobody';
-withdb { is $db->problem('pb')->owner->id, 'nobody', 'gruntmaster-problem set' };
-
-withdb { $db->problems->create({id => 'dummy', name => 'Dummy', generator => 'Undef', runner => 'File', judge => 'Absolute', level => 'beginner', owner => 'MGV', statement => '...', testcnt => 1, timeout => 1}) };
-
-@list = sort `./gruntmaster-problem list`;
-chomp @list;
-@list2 = withdb { map { $_->id } $db->problems->all };
-is_deeply \@list, [ sort @list2 ], 'gruntmaster-problem list';