File: headers-etag.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 (28 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (6)
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
print "1..4\n";

require HTTP::Headers::ETag;

$h = HTTP::Headers->new;
$h->etag("tag1");
print "not " unless $h->etag eq qq("tag1");
print "ok 1\n";

$h->etag("w/tag2");
print "not " unless $h->etag eq qq(W/"tag2");
print "ok 2\n";

$h->if_match(qq(W/"foo", bar, baz), "bar");
$h->if_none_match(333);

$h->if_range("tag3");
print "not " unless $h->if_range eq qq("tag3");
print "ok 3\n";

$t = time;
$h->if_range($t);
print "not " unless $h->if_range == $t;
print "ok 4\n";


print $h->as_string;