File: clone.t

package info (click to toggle)
liburi-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 608 kB
  • ctags: 303
  • sloc: perl: 4,914; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 398 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
#!perl -w

use strict;
use warnings;

print "1..2\n";

use URI::URL;

my $b = URI::URL->new("http://www/");

my $u1 = URI::URL->new("foo", $b);
my $u2 = $u1->clone;

$u1->base("http://yyy/");

#use Data::Dump; Data::Dump::dump($b, $u1, $u2);

print "not " unless $u1->abs->as_string eq "http://yyy/foo";
print "ok 1\n";

print "not " unless $u2->abs->as_string eq "http://www/foo";
print "ok 2\n";