Skip to content

Commit 4bd9ccb

Browse files
committed
Replace "print" with "note" in tests
Saves needing to manually prefix the messages for TAP and is more idiomatic.
1 parent f1b74ec commit 4bd9ccb

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Revision history for HTTP-Message
22

33
{{$NEXT}}
44
- Replace "base" with "parent" (GH#176) (James Raspass)
5+
- Replace "print" with "note" in tests (GH#178) (James Raspass)
56

67
6.37 2022-06-14 14:08:55Z
78
- Support for Brotli "br" encoding (GH#163) (trizen and Julien Fiegehenn)

t/headers-auth.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $res->www_authenticate("Basic realm=foo1");
2828
note $res->as_string;
2929

3030
$res->www_authenticate(Basic => {realm => "foo2"});
31-
print $res->as_string;
31+
note $res->as_string;
3232

3333
$res->www_authenticate(Basic => [realm => "foo3", foo=>33],
3434
Digest => {nonce=>"bar", foo=>'foo'});

t/response.t

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $r->date($time - 25);
3434
$r->last_modified($time - 5000000);
3535
$r->request($req);
3636

37-
#print $r->as_string;
37+
#note $r->as_string;
3838

3939
my $current_age = $r->current_age;
4040

@@ -48,19 +48,15 @@ my $is_fresh = $r->is_fresh;
4848
ok($is_fresh);
4949
is($r->is_fresh(heuristic_expiry => 0), undef);
5050

51-
print "# current_age = $current_age\n";
52-
print "# freshness_lifetime = $freshness_lifetime\n";
53-
print "# response is ";
54-
print " not " unless $is_fresh;
55-
print "fresh\n";
56-
57-
print "# it will be fresh for ";
58-
print $freshness_lifetime - $current_age;
59-
print " more seconds\n";
51+
note "current_age = $current_age";
52+
note "freshness_lifetime = $freshness_lifetime";
53+
note "response is ", "not " x !$is_fresh, "fresh";
54+
note "it will be fresh for ", $freshness_lifetime - $current_age,
55+
" more seconds";
6056

6157
# OK, now we add an Expires header
6258
$r->expires($time);
63-
print "\n", $r->dump(prefix => "# ");
59+
note "\n", $r->dump;
6460

6561
$freshness_lifetime = $r->freshness_lifetime;
6662
is($freshness_lifetime, 25);
@@ -71,13 +67,13 @@ $r->header('Age', 300);
7167
$r->push_header('Cache-Control', 'junk');
7268
$r->push_header(Cache_Control => 'max-age = 10');
7369

74-
#print $r->as_string;
70+
#note $r->as_string;
7571

7672
$current_age = $r->current_age;
7773
$freshness_lifetime = $r->freshness_lifetime;
7874

79-
print "# current_age = $current_age\n";
80-
print "# freshness_lifetime = $freshness_lifetime\n";
75+
note "current_age = $current_age";
76+
note "freshness_lifetime = $freshness_lifetime";
8177

8278
ok($current_age >= 300);
8379
is($freshness_lifetime, 10);

0 commit comments

Comments
 (0)