]>
iEval git - gruntmaster-data.git/blob - t/Gruntmaster-Opener.t
5 use Test
::More tests
=> 8;
6 use Gruntmaster
::Opener
;
10 no warnings
'redefine';
11 *Gruntmaster
::Opener
::open_problem
= sub { $opened = 1 };
15 my ($line, $should_open, $name) = @_;
16 $line =~ s
,DATE
,[01/Jan/2015:00:00:00 +0200],;
19 is
$opened, $should_open, $name
22 _test
'192.0.2.41 - mgv DATE "GET /pb/problem1?contest=test HTTP/1.1" 200 1234', 1, 'normal case';
23 _test
'192.0.2.41 - mgv DATE "HEAD http://gruntmaster.example.org/pb/problem1?contest=test HTTP/1.0" 200 1234', 1, 'absolute url';
24 _test
'2001:db8:abcd::1234 - mgv DATE "GET /pb/%61%62%63%64?%63ontes%74=%62%61%64 SPDY/3" 200 1234', 1, 'superfluous percent encoding';
26 _test
'192.0.2.41 - mgv DATE "GET /pb/problem1?contest=test HTTP/1.1" 500 1234', '', 'internal server error';
27 _test
'192.0.2.41 - - DATE "GET /pb/problem1?contest=test HTTP/1.1" 401 1234', '', 'not logged in';
28 _test
'192.0.2.41 - mgv DATE "GET /pb/?contest=test HTTP/1.0" 200 1234', '', 'problem list';
29 _test
'2001:db8:abcd::1234 - mgv DATE "GET /pb/asd SPDY/3" 200 1234', '', 'not in contest';
30 _test
'junk', '', 'junk';
This page took 0.051659 seconds and 4 git commands to generate.