diff options
author | Dorian Taylor <dorian.taylor.lists@gmail.com> | 2018-12-11 14:31:48 -0800 |
---|---|---|
committer | Olaf Alders <olaf@wundersolutions.com> | 2019-01-08 14:40:42 -0500 |
commit | c77b2bc35d8bb6f469851f97ec0354c67f0228fe (patch) | |
tree | 31cb0bf97f0b94ff0c2ff3035c4a709acfa3712a /t | |
parent | 5ad7306340f61d65af4da31ca47bdb95bfb479be (diff) | |
download | uri-c77b2bc35d8bb6f469851f97ec0354c67f0228fe.tar.gz |
closes #57 (canonical always clones)
Diffstat (limited to 't')
-rw-r--r-- | t/generic.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/generic.t b/t/generic.t index e2f7b97..0d8f529 100644 --- a/t/generic.t +++ b/t/generic.t @@ -1,9 +1,10 @@ use strict; use warnings; -print "1..48\n"; +print "1..49\n"; use URI; +use Scalar::Util qw(refaddr); my $foo = URI->new("Foo:opaque#frag"); @@ -217,3 +218,8 @@ $old = $foo->query("q"); print "not " unless !defined($old) && $foo eq "?q"; print "ok 48\n"; +# canonical must always be a clone +my $c1 = $foo->canonical; # canonicalize first +my $c2 = $c1->canonical; # canonicalize again +print 'not ' if refaddr($c1) == refaddr($c2) or $$c1 ne $$c2; +print "ok 49\n"; |