File: 500-all.t

package info (click to toggle)
libhttp-throwable-perl 0.028-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 428 kB
  • sloc: perl: 1,354; makefile: 2; sh: 1
file content (45 lines) | stat: -rw-r--r-- 905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl
use strict;
use warnings;

use Test::Deep qw(ignore re);
use Test::More;
use Test::Fatal;

use lib 't/lib';
use Test::HT;

ht_test(InternalServerError => {}, {
    code   => 500,
    reason => 'Internal Server Error',
    length => ignore(),
    body   => re(qr{500 Internal Server Error.+at \S*t.lib.Test.HT.pm}s),
});

ht_test(NotImplemented => {}, {
    code   => 501,
    reason => 'Not Implemented',
});

ht_test(BadGateway => {}, {
    code   => 502,
    reason => 'Bad Gateway',
});

ht_test(ServiceUnavailable => { retry_after => 'A Little While' }, {
    code    => 503,
    reason  => 'Service Unavailable',
    headers => [ 'Retry-After' => 'A Little While' ],
});

ht_test(GatewayTimeout => {}, {
    code   => 504,
    reason => 'Gateway Timeout',
});

ht_test(HTTPVersionNotSupported => {}, {
    code   => 505,
    reason => 'HTTP Version Not Supported',
});

done_testing;