File: status.t

package info (click to toggle)
libwww-perl 5.36-1.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 848 kB
  • ctags: 400
  • sloc: perl: 6,366; makefile: 51; sh: 6
file content (32 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (7)
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
use HTTP::Status;

print "1..8\n";

200 == RC_OK || print "not ";
print "ok 1\n";

is_success(RC_ACCEPTED) || print "not ";
print "ok 2\n";

is_error(RC_BAD_REQUEST) || print "not ";
print "ok 3\n";

is_redirect(RC_MOVED_PERMANENTLY) || print "not ";
print "ok 4\n";

is_success(RC_NOT_FOUND) && print "not ";
print "ok 5\n";

$mess = status_message(0);

defined $mess && print "not ";
print "ok 6\n";

$mess = status_message(200);

if ($mess =~ /ok/i) {
    print "ok 7\n";
}

is_info(RC_CONTINUE) || print "not ";
print "ok 8\n";