Progra/Test.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 93.9% 31 / 33 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Progra.pm ↑ Summary
1 package OnlineJudge::Progra::Test;
2  
3 2 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.023';
8  
9 # Simple get subroutine
10 1 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
11 1 my @foo;
12 1 my $path = getcwd;
13
14 # We create some dummy requests
15
16 # accepted
17 1 my $r1 = {
18 'rid' => 1,
19 'timelimit' => 1,
20 'testcases' => 1,
21 'maxscore' => 100,
22 'lang' => 'pl',
23 'sourcecode' => $path.'/t/03_judge01.pl',
24 'compile' => 0,
25 'userpath' => $path.'/t/usr/',
26 'taskpath' => $path.'/t/task/',
27 };
28
29 # compilation error
30 1 my $r2 = {
31 'rid' => 1,
32 'timelimit' => 1,
33 'testcases' => 1,
34 'maxscore' => 100,
35 'lang' => 'c',
36 'sourcecode' => $path.'/t/03_judge02.c',
37 'compile' => 1,
38 'userpath' => $path.'/t/usr/',
39 'taskpath' => $path.'/t/task/',
40 };
41
42 # time limit
43 1 my $r3 = {
44 'rid' => 1,
45 'timelimit' => 1,
46 'testcases' => 1,
47 'maxscore' => 100,
48 'lang' => 'pl',
49 'sourcecode' => $path.'/t/03_judge03.pl',
50 'compile' => 0,
51 'userpath' => $path.'/t/usr/',
52 'taskpath' => $path.'/t/task/',
53 };
54
55 # wrong answer
56 1 my $r4 = {
57 'rid' => 1,
58 'timelimit' => 1,
59 'testcases' => 1,
60 'maxscore' => 100,
61 'lang' => 'pl',
62 'sourcecode' => $path.'/t/03_judge04.pl',
63 'compile' => 0,
64 'userpath' => $path.'/t/usr/',
65 'taskpath' => $path.'/t/task/',
66 };
67
68 # badword
69 1 my $r5 = {
70 'rid' => 1,
71 'timelimit' => 1,
72 'testcases' => 1,
73 'maxscore' => 100,
74 'lang' => 'pl',
75 'sourcecode' => $path.'/t/03_judge05.pl',
76 'compile' => 0,
77 'userpath' => $path.'/t/usr/',
78 'taskpath' => $path.'/t/task/',
79 };
80
81
82 1 push(@foo, $r1);
83 1 push(@foo, $r2);
84 1 push(@foo, $r3);
85 1 push(@foo, $r4);
86 1 push(@foo, $r5);
87
88 1 return @foo;
89 }
90  
91 # Simple update subroutine
92 5 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
Pod undocumented
93 5 my $r = shift;
94
95 5 return $r->{'comment'};
96 }
97  
98 2 1;
« Progra.pm ↑ Summary