Hello community, here is the log from the commit of package perl-IRI for openSUSE:Factory checked in at 2020-02-21 16:42:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-IRI (Old) and /work/SRC/openSUSE:Factory/.perl-IRI.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-IRI" Fri Feb 21 16:42:51 2020 rev:7 rq:777897 version:0.011 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-IRI/perl-IRI.changes 2019-12-30 12:34:56.935808318 +0100 +++ /work/SRC/openSUSE:Factory/.perl-IRI.new.26092/perl-IRI.changes 2020-02-21 16:43:01.622113252 +0100 @@ -1,0 +2,10 @@ +Fri Feb 21 03:10:50 UTC 2020 - <[email protected]> + +- updated to 0.011 + see /usr/share/doc/packages/perl-IRI/Changes + + 0.011 2020-02-20 + + - (Update) Add IRI->rel method. + +------------------------------------------------------------------- Old: ---- IRI-0.010.tar.gz New: ---- IRI-0.011.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IRI.spec ++++++ --- /var/tmp/diff_new_pack.4MwVZq/_old 2020-02-21 16:43:03.066116138 +0100 +++ /var/tmp/diff_new_pack.4MwVZq/_new 2020-02-21 16:43:03.090116185 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-IRI # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-IRI -Version: 0.010 +Version: 0.011 Release: 0 %define cpan_name IRI Summary: Internationalized Resource Identifiers @@ -49,6 +49,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor @@ -64,6 +65,6 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc Changes Changes.ttl Changes.xml README +%doc Changes README %changelog ++++++ IRI-0.010.tar.gz -> IRI-0.011.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/Changes new/IRI-0.011/Changes --- old/IRI-0.010/Changes 2019-12-27 20:20:03.000000000 +0100 +++ new/IRI-0.011/Changes 2020-02-20 06:03:12.745419488 +0100 @@ -6,6 +6,10 @@ Bug tracker: <http://rt.cpan.org/Dist/Display.html?Queue=IRI> Maintainer: Gregory Todd Williams <mailto:[email protected]> +0.011 2020-02-20 + + - (Update) Add IRI->rel method. + 0.010 2019-12-26 - (Update) Fix component resolution to remove dots when base resolution diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/Changes.ttl new/IRI-0.011/Changes.ttl --- old/IRI-0.010/Changes.ttl 2019-12-27 20:19:43.000000000 +0100 +++ new/IRI-0.011/Changes.ttl 1970-01-01 01:00:00.000000000 +0100 @@ -1,188 +0,0 @@ -# -*-n3-*- - -@prefix dc: <http://purl.org/dc/elements/1.1/> . -@prefix dcterms: <http://purl.org/dc/terms/> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix asc: <http://aaronland.info/ns/changefile/> . -@prefix my: <http://purl.org/NET/cpan-uri/dist/IRI/> . - -<> - dc:title "Changes" ; - dc:description "Changes for IRI" ; - dc:subject my:project ; - . - - -<http://kasei.us/code/files/IRI-0.010.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.009.tar.gz> ; - - doap:Version [ - doap:revision "0.010" ; - doap:created "2019-12-26" ; - ] ; - asc:changes [ - asc:update "Fix component resolution to remove dots when base resolution occurs without a scheme but with a user/port/host." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.009.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.008.tar.gz> ; - - doap:Version [ - doap:revision "0.009" ; - doap:created "2018-10-30" ; - ] ; - asc:changes [ - asc:update "Reduce Minimum Perl Version to 5.10 (#12 from @tehmoth)." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.008.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.007.tar.gz> ; - - doap:Version [ - doap:revision "0.008" ; - doap:created "2017-08-06" ; - ] ; - asc:changes [ - asc:update "Fix typo in regex rule causing problems parsing codepoints beyond BMP (#11)." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.007.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.006.tar.gz> ; - - doap:Version [ - doap:revision "0.007" ; - doap:created "2017-04-03" ; - ] ; - asc:changes [ - asc:addition "Add query_form accessor and set_query_param constructor (#4)." ; - asc:update "Updated Makefile.PL for perl 5.26." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.006.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.005.tar.gz> ; - - doap:Version [ - doap:revision "0.006" ; - doap:created "2016-07-19" ; - ] ; - asc:changes [ - asc:update "Fix regular expression use of quantifiers (#8 from Karl Williamson)." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.005.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.004.tar.gz> ; - - doap:Version [ - doap:revision "0.005" ; - doap:created "2016-04-04" ; - ] ; - asc:changes [ - asc:addition "Add ability to lazily parse IRI components." ; - asc:addition "Add cpanfile, with Module::Install deps (#5 from Alberto Simões)." ; - asc:addition "Added Try::Tiny to list of build requirements (github issue #3)." ; - asc:update "Improve performance of IRI component parsing." ; - asc:update "Updated required version of Type::Tiny to 0.008 to support use of InstanceOf (#7 from Alexandr Ciornii)." ; - asc:update "Update POD coverage test to ignore private attributes (#6 from Alberto Simões)." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.004.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.003.tar.gz> ; - - doap:Version [ - doap:revision "0.004" ; - doap:created "2014-09-25" ; - ] ; - asc:changes [ - asc:update "Moved modules from Moose to Moo." ; - asc:update "Changed IRI to use old-style VERSION declaration." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.003.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.002.tar.gz> ; - - doap:Version [ - doap:revision "0.003" ; - doap:created "2014-08-11" ; - ] ; - asc:changes [ - asc:addition "Added coercion from Str to IRI." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.002.tar.gz> - dcterms:isVersionOf my:project ; - dcterms:replaces <http://kasei.us/code/files/IRI-0.001.tar.gz> ; - - doap:Version [ - doap:revision "0.002" ; - doap:created "2014-08-09" ; - ] ; - asc:changes [ - asc:addition "Added as_string method." ; - ] ; - . - - -<http://kasei.us/code/files/IRI-0.001.tar.gz> - dcterms:isVersionOf my:project ; - - doap:Version [ - doap:revision "0.001" ; - doap:created "2014-08-02" ; - ] ; - asc:changes [ - asc:addition "First release." ; -# asc:update "" ; - ] ; - . - - -my:project - a doap:Project ; - doap:name "IRI" ; - doap:shortdesc "A Perl implementation of Internationalized Resource Identifiers (IRIs)"@en ; - doap:programming-language "Perl" ; - doap:homepage <http://search.cpan.org/dist/IRI/> ; - doap:download-page <http://search.cpan.org/dist/IRI/> ; - doap:bug-database <http://rt.cpan.org/Dist/Display.html?Queue=IRI> ; - doap:maintainer <http://kasei.us/about/foaf.xrdf#greg> ; - doap:developer <http://kasei.us/about/foaf.xrdf#greg> ; - doap:documenter <http://kasei.us/about/foaf.xrdf#greg> ; - doap:tester <http://kasei.us/about/foaf.xrdf#greg> ; - doap:created "2014-07-23"^^xsd:date ; - doap:license <http://dev.perl.org/licenses/> ; - . - -<http://kasei.us/about/foaf.xrdf#greg> - a foaf:Person ; - foaf:name "Gregory Todd Williams" ; - foaf:homepage <http://kasei.us/> ; - foaf:page <http://search.cpan.org/~gwilliams/> ; - foaf:mbox <mailto:[email protected]> ; - <http://www.w3.org/2002/07/owl#sameAs> <http://purl.org/NET/cpan-uri/person/gwilliams> ; - . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/Changes.xml new/IRI-0.011/Changes.xml --- old/IRI-0.010/Changes.xml 2019-12-27 20:20:03.000000000 +0100 +++ new/IRI-0.011/Changes.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,167 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dbug="http://ontologi.es/doap-bugs#" xmlns:dc="http://purl.org/dc/terms/" xmlns:dcs="http://ontologi.es/doap-changeset#" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> -<rdf:Description rdf:nodeID="r1577474403r0"> - <doap:created>2019-12-26</doap:created> - <doap:revision>0.010</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r1"> - <ns1:update>Fix component resolution to remove dots when base resolution occurs without a scheme but with a user/port/host.</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r10"> - <doap:created>2016-04-04</doap:created> - <doap:revision>0.005</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r11"> - <ns1:addition>Add ability to lazily parse IRI components.</ns1:addition> - <ns1:addition>Add cpanfile, with Module::Install deps (#5 from Alberto Simões).</ns1:addition> - <ns1:addition>Added Try::Tiny to list of build requirements (github issue #3).</ns1:addition> - <ns1:update>Improve performance of IRI component parsing.</ns1:update> - <ns1:update>Update POD coverage test to ignore private attributes (#6 from Alberto Simões).</ns1:update> - <ns1:update>Updated required version of Type::Tiny to 0.008 to support use of InstanceOf (#7 from Alexandr Ciornii).</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r12"> - <doap:created>2014-09-25</doap:created> - <doap:revision>0.004</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r13"> - <ns1:update>Changed IRI to use old-style VERSION declaration.</ns1:update> - <ns1:update>Moved modules from Moose to Moo.</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r14"> - <doap:created>2014-08-11</doap:created> - <doap:revision>0.003</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r15"> - <ns1:addition>Added coercion from Str to IRI.</ns1:addition> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r16"> - <doap:created>2014-08-09</doap:created> - <doap:revision>0.002</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r17"> - <ns1:addition>Added as_string method.</ns1:addition> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r18"> - <doap:created>2014-08-02</doap:created> - <doap:revision>0.001</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r19"> - <ns1:addition>First release.</ns1:addition> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r2"> - <doap:created>2018-10-30</doap:created> - <doap:revision>0.009</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r3"> - <ns1:update>Reduce Minimum Perl Version to 5.10 (#12 from @tehmoth).</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r4"> - <doap:created>2017-08-06</doap:created> - <doap:revision>0.008</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r5"> - <ns1:update>Fix typo in regex rule causing problems parsing codepoints beyond BMP (#11).</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r6"> - <doap:created>2017-04-03</doap:created> - <doap:revision>0.007</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r7"> - <ns1:addition>Add query_form accessor and set_query_param constructor (#4).</ns1:addition> - <ns1:update>Updated Makefile.PL for perl 5.26.</ns1:update> -</rdf:Description> -<rdf:Description rdf:nodeID="r1577474403r8"> - <doap:created>2016-07-19</doap:created> - <doap:revision>0.006</doap:revision> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:nodeID="r1577474403r9"> - <ns1:update>Fix regular expression use of quantifiers (#8 from Karl Williamson).</ns1:update> -</rdf:Description> -<rdf:Description xmlns:ns1="http://purl.org/dc/elements/1.1/" rdf:about="file:///Users/greg/data/prog/git/perl-iri/Changes.ttl"> - <ns1:description>Changes for IRI</ns1:description> - <ns1:subject rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <ns1:title>Changes</ns1:title> -</rdf:Description> -<rdf:Description xmlns:ns1="http://www.w3.org/2002/07/owl#" rdf:about="http://kasei.us/about/foaf.xrdf#greg"> - <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/> - <ns1:sameAs rdf:resource="http://purl.org/NET/cpan-uri/person/gwilliams"/> - <foaf:homepage rdf:resource="http://kasei.us/"/> - <foaf:mbox rdf:resource="mailto:[email protected]"/> - <foaf:name>Gregory Todd Williams</foaf:name> - <foaf:page rdf:resource="http://search.cpan.org/~gwilliams/"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.001.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r19"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <doap:Version rdf:nodeID="r1577474403r18"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.002.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r17"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.001.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r16"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.003.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r15"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.002.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r14"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.004.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r13"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.003.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r12"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.005.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r11"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.004.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r10"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.006.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r9"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.005.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r8"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.007.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r7"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.006.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r6"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.008.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r5"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.007.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r4"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.009.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r3"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.008.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r2"/> -</rdf:Description> -<rdf:Description xmlns:ns1="http://aaronland.info/ns/changefile/" rdf:about="http://kasei.us/code/files/IRI-0.010.tar.gz"> - <ns1:changes rdf:nodeID="r1577474403r1"/> - <dc:isVersionOf rdf:resource="http://purl.org/NET/cpan-uri/dist/IRI/project"/> - <dc:replaces rdf:resource="http://kasei.us/code/files/IRI-0.009.tar.gz"/> - <doap:Version rdf:nodeID="r1577474403r0"/> -</rdf:Description> -<rdf:Description rdf:about="http://purl.org/NET/cpan-uri/dist/IRI/project"> - <doap:bug-database rdf:resource="http://rt.cpan.org/Dist/Display.html?Queue=IRI"/> - <doap:created rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2014-07-23</doap:created> - <doap:developer rdf:resource="http://kasei.us/about/foaf.xrdf#greg"/> - <doap:documenter rdf:resource="http://kasei.us/about/foaf.xrdf#greg"/> - <doap:download-page rdf:resource="http://search.cpan.org/dist/IRI/"/> - <doap:homepage rdf:resource="http://search.cpan.org/dist/IRI/"/> - <doap:license rdf:resource="http://dev.perl.org/licenses/"/> - <doap:maintainer rdf:resource="http://kasei.us/about/foaf.xrdf#greg"/> - <doap:name>IRI</doap:name> - <doap:programming-language>Perl</doap:programming-language> - <doap:shortdesc xml:lang="en">A Perl implementation of Internationalized Resource Identifiers (IRIs)</doap:shortdesc> - <doap:tester rdf:resource="http://kasei.us/about/foaf.xrdf#greg"/> - <rdf:type rdf:resource="http://usefulinc.com/ns/doap#Project"/> -</rdf:Description> -</rdf:RDF> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/MANIFEST new/IRI-0.011/MANIFEST --- old/IRI-0.010/MANIFEST 2019-12-27 20:20:08.000000000 +0100 +++ new/IRI-0.011/MANIFEST 2020-02-20 06:03:20.000000000 +0100 @@ -1,6 +1,4 @@ Changes -Changes.ttl -Changes.xml inc/Module/Install.pm inc/Module/Install/AuthorTests.pm inc/Module/Install/Base.pm @@ -15,9 +13,12 @@ Makefile.PL MANIFEST This list of files META.yml +meta/changes.ttl t/00-simple.t +t/base_resolution.t t/bugs.t t/coercion.t +t/rel.t xt/pod-coverage.t xt/pod.t README diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/META.yml new/IRI-0.011/META.yml --- old/IRI-0.010/META.yml 2019-12-27 20:20:04.000000000 +0100 +++ new/IRI-0.011/META.yml 2020-02-20 06:03:12.000000000 +0100 @@ -33,4 +33,4 @@ homepage: http://search.cpan.org/dist/IRI/ license: http://dev.perl.org/licenses/ repository: http://github.com/kasei/perl-iri/ -version: '0.010' +version: '0.011' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/Makefile.PL new/IRI-0.011/Makefile.PL --- old/IRI-0.010/Makefile.PL 2019-12-27 05:41:26.000000000 +0100 +++ new/IRI-0.011/Makefile.PL 2020-02-11 06:26:03.391835397 +0100 @@ -27,9 +27,7 @@ author_tests('xt'); -write_doap_changes; -write_doap_changes_xml; +write_doap_changes "meta/changes.ttl", "Changes", "turtle"; sign; - WriteAll; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/SIGNATURE new/IRI-0.011/SIGNATURE --- old/IRI-0.010/SIGNATURE 2019-12-27 20:20:10.000000000 +0100 +++ new/IRI-0.011/SIGNATURE 2020-02-20 06:03:22.000000000 +0100 @@ -14,12 +14,10 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 39863391b94295ef7e06d5a0c8034b704daf4300 Changes -SHA1 fa67c6e245fb197e8b8bfbce795d61b400d23573 Changes.ttl -SHA1 fec8903e0214343bb1d3f8c251cb912586717699 Changes.xml -SHA1 88a9956a698251e7037d96cf9091eb61793d5ab7 MANIFEST -SHA1 f5937015a7fa4811a84408f279a6f6b0b02a9ad1 META.yml -SHA1 adc55e40b7c0f43e8b79c24b28528386a678e89e Makefile.PL +SHA1 43a84ac3eb3206811e4c7c7315af7f3e79086a96 Changes +SHA1 0c6652094272d8b36528dd35577f71901f03abd5 MANIFEST +SHA1 872428ff061562f3118fbcc8a06424690975f5a9 META.yml +SHA1 7e7600a37c1c10b0e64482d8ebe24fee1510622e Makefile.PL SHA1 b20558223028621fcd8a6d7303b445bdd5ae85e1 README SHA1 05a17c51aceb6435a1eac17137f19911a09e5050 inc/Module/Install.pm SHA1 d001b4b9a48395a8c4134b234a0e1789138427c5 inc/Module/Install/AuthorTests.pm @@ -31,16 +29,19 @@ SHA1 2f5be6af6098acf6d786a4a7299a34d0c6c04ef9 inc/Module/Install/Metadata.pm SHA1 aa6723cc4a8d4475026f6ceb28e1f16459e8a11b inc/Module/Install/Win32.pm SHA1 6661285caedfe012cb5a1ca915a422ffc292ae2b inc/Module/Install/WriteAll.pm -SHA1 83a02f27d8691acec179be4c4c69ba6318ad17b4 lib/IRI.pm -SHA1 8239904ffc3b6705243167ccb7ed4da00d5d2543 t/00-simple.t +SHA1 8e2daa91cf80f0f2363f26cac3be0588419e6812 lib/IRI.pm +SHA1 9e985a09ae47f724f1acc57584d68e03cbc9ea7c meta/changes.ttl +SHA1 4df723cc8618eaa69c10154965279e08344372f1 t/00-simple.t +SHA1 d9dae25d9995d427832fffd8ad5bc2c552b28ae7 t/base_resolution.t SHA1 dcdc21dd75dd1bfc59ea44a886565bf94a133504 t/bugs.t SHA1 49bf69502718d2931ede3fa80220628841d3ab2d t/coercion.t +SHA1 a47f1390c93a750270e443e97143c8b31d3267b8 t/rel.t SHA1 c179a0e5169b56dd5d6c8eae04cba68383158224 xt/pod-coverage.t SHA1 6387af7a5fde0747be5bc9ad2ec15ca9759bd95a xt/pod.t -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org -iEYEARECAAYFAl4GWWgACgkQhPK6VMqoyC1oTACdFDrBi9/JdhwPnnKdyDdibXTV -PikAnA8TQN5nGN+iF3ZSXc9A1Vx4kPMM -=e2fd +iEYEARECAAYFAl5OExgACgkQhPK6VMqoyC1NEwCgiQrqQJGl9bgeR3iF0wUOe/X1 +hlEAn18F73DafP2Rh76eUl/IidH+rFPm +=Q3YQ -----END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/lib/IRI.pm new/IRI-0.011/lib/IRI.pm --- old/IRI-0.010/lib/IRI.pm 2019-12-27 20:19:43.000000000 +0100 +++ new/IRI-0.011/lib/IRI.pm 2020-02-20 06:00:57.232985940 +0100 @@ -6,7 +6,7 @@ =head1 VERSION -This document describes IRI version 0.010 +This document describes IRI version 0.011 =head1 SYNOPSIS @@ -80,7 +80,7 @@ package IRI; use v5.10.1; use warnings; - our $VERSION = '0.010'; + our $VERSION = '0.011'; use Moo; use MooX::HandlesVia; use Types::Standard qw(Str InstanceOf HashRef Bool); @@ -112,8 +112,10 @@ isa => HashRef, lazy => 1, builder => '_resolved_components', + predicate => 1, handles_via => 'Hash', handles => { + authority => [ accessor => 'authority' ], scheme => [ accessor => 'scheme' ], host => [ accessor => 'host' ], port => [ accessor => 'port' ], @@ -135,10 +137,15 @@ sub BUILD { my $self = shift; - unless ($self->lazy) { - my $comp = $self->_parse_components($self->value); + if ($self->has_resolved_components) { + $self->_set_components($self->resolved_components); + $self->_initialized(1); + } else { + unless ($self->lazy) { + my $comp = $self->_parse_components($self->value); + } } - } + } before [qw(components as_string abs resolved_components scheme host port user path fragment query)] => sub { my $self = shift; @@ -224,7 +231,7 @@ my $iregname = qr<(${iunreserved}|${pctencoded}|${subdelims})*>o; my $ihost = qr<(?<host>${IPliteral}|${IPv4address}|${iregname})>o; my $iuserinfo = qr<(?<user>(${iunreserved}|${pctencoded}|${subdelims}|:)*)>o; - my $iauthority = qr<(${iuserinfo}@)?${ihost}(:${port})?>o; + my $iauthority = qr<(?<authority>(${iuserinfo}@)?${ihost}(:${port})?)>o; my $irelativepart = qr< (//${iauthority}${ipathabempty}) | ${ipathabsolute} @@ -394,9 +401,112 @@ return $value; } +=item C<< rel ( $base ) >> + +Returns a new relative IRI object which, when resolved against the C<< $base >> +IRI, is equal to this IRI. + +=cut + + sub rel { + # based on code in URI <https://metacpan.org/source/OALDERS/URI-1.76/lib/URI/_generic.pm#L191> + my $self = shift; + my $base = shift; + my $rel = IRI->new(value => $self->abs); + + if (($base->scheme // '') ne ($rel->scheme // '')) { + return IRI->new(value => $rel->abs); + } + + my $scheme = $rel->scheme; + my $auth = $rel->authority; + my $path = $rel->path; + + if (!defined($scheme) and !defined($auth)) { + return $rel; + } + + my $bscheme = $base->scheme; + my $bauth = $base->authority; + my $bpath = $base->path; + + for ($bscheme, $bauth, $auth) { + $_ = '' unless defined($_); + } + + if ($scheme eq $bscheme) { + $rel->scheme(undef); + } + + unless ($scheme eq $bscheme and $auth eq $bauth) { + return IRI->new(value => $rel->_abs); + } + + for ($path, $bpath) { + $_ = "/$_" unless m{^/}; + } + + # Make it relative by eliminating: + # the scheme, + $rel->scheme(undef); + + # ... and authority + $rel->host(undef); + $rel->port(undef); + $rel->user(undef); + + + my @rparts = split('/', $path); + my @bparts = split('/', $bpath); + shift(@rparts); + shift(@bparts); + if (scalar(@rparts) and (scalar(@bparts) and $rparts[0] ne $bparts[0])) { + # use an absolute path, because $rel differs from $base at the very beginning + } else { + # This loop is based on code from Nicolai Langfeldt <[email protected]>. + # First we calculate common initial path components length ($li). + my $li = 1; + while (1) { + my $i = index($path, '/', $li); + last if $i < 0 || + $i != index($bpath, '/', $li) || + substr($path,$li,$i-$li) ne substr($bpath,$li,$i-$li); + $li=$i+1; + } + + # then we nuke it from both paths + substr($path, 0,$li) = ''; + substr($bpath,0,$li) = ''; + + + if ($path eq $bpath) { + $rel->path(''); + if (defined($rel->query) and defined($base->query)) { + if ($rel->query eq $base->query) { + $rel->query(undef); + } else { + # + } + } elsif (defined($rel->query)) { + # + } elsif (defined($base->query)) { + $rel->path($path); + } else { + # + } + } else { + # Add one "../" for each path component left in the base path + $path = ('../' x $bpath =~ tr|/|/|) . $path; + $path = "./" if $path eq ''; + $rel->path($path); + } + } + return IRI->new(value => $rel->_abs); + } + sub as_string { my $self = shift; - if ($self->has_base) { + if ($self->has_base || $self->has_resolved_components) { return $self->abs; } else { return $self->value; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/meta/changes.ttl new/IRI-0.011/meta/changes.ttl --- old/IRI-0.010/meta/changes.ttl 1970-01-01 01:00:00.000000000 +0100 +++ new/IRI-0.011/meta/changes.ttl 2020-02-20 06:00:26.532123138 +0100 @@ -0,0 +1,202 @@ +# -*-n3-*- + +@prefix dc: <http://purl.org/dc/elements/1.1/> . +@prefix dcterms: <http://purl.org/dc/terms/> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix asc: <http://aaronland.info/ns/changefile/> . +@prefix my: <http://purl.org/NET/cpan-uri/dist/IRI/> . + +<> + dc:title "Changes" ; + dc:description "Changes for IRI" ; + dc:subject my:project ; + . + + +<http://kasei.us/code/files/IRI-0.011.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.010.tar.gz> ; + + doap:Version [ + doap:revision "0.011" ; + doap:created "2020-02-20" ; + ] ; + asc:changes [ + asc:update "Add IRI->rel method." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.010.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.009.tar.gz> ; + + doap:Version [ + doap:revision "0.010" ; + doap:created "2019-12-26" ; + ] ; + asc:changes [ + asc:update "Fix component resolution to remove dots when base resolution occurs without a scheme but with a user/port/host." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.009.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.008.tar.gz> ; + + doap:Version [ + doap:revision "0.009" ; + doap:created "2018-10-30" ; + ] ; + asc:changes [ + asc:update "Reduce Minimum Perl Version to 5.10 (#12 from @tehmoth)." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.008.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.007.tar.gz> ; + + doap:Version [ + doap:revision "0.008" ; + doap:created "2017-08-06" ; + ] ; + asc:changes [ + asc:update "Fix typo in regex rule causing problems parsing codepoints beyond BMP (#11)." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.007.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.006.tar.gz> ; + + doap:Version [ + doap:revision "0.007" ; + doap:created "2017-04-03" ; + ] ; + asc:changes [ + asc:addition "Add query_form accessor and set_query_param constructor (#4)." ; + asc:update "Updated Makefile.PL for perl 5.26." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.006.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.005.tar.gz> ; + + doap:Version [ + doap:revision "0.006" ; + doap:created "2016-07-19" ; + ] ; + asc:changes [ + asc:update "Fix regular expression use of quantifiers (#8 from Karl Williamson)." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.005.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.004.tar.gz> ; + + doap:Version [ + doap:revision "0.005" ; + doap:created "2016-04-04" ; + ] ; + asc:changes [ + asc:addition "Add ability to lazily parse IRI components." ; + asc:addition "Add cpanfile, with Module::Install deps (#5 from Alberto Simões)." ; + asc:addition "Added Try::Tiny to list of build requirements (github issue #3)." ; + asc:update "Improve performance of IRI component parsing." ; + asc:update "Updated required version of Type::Tiny to 0.008 to support use of InstanceOf (#7 from Alexandr Ciornii)." ; + asc:update "Update POD coverage test to ignore private attributes (#6 from Alberto Simões)." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.004.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.003.tar.gz> ; + + doap:Version [ + doap:revision "0.004" ; + doap:created "2014-09-25" ; + ] ; + asc:changes [ + asc:update "Moved modules from Moose to Moo." ; + asc:update "Changed IRI to use old-style VERSION declaration." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.003.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.002.tar.gz> ; + + doap:Version [ + doap:revision "0.003" ; + doap:created "2014-08-11" ; + ] ; + asc:changes [ + asc:addition "Added coercion from Str to IRI." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.002.tar.gz> + dcterms:isVersionOf my:project ; + dcterms:replaces <http://kasei.us/code/files/IRI-0.001.tar.gz> ; + + doap:Version [ + doap:revision "0.002" ; + doap:created "2014-08-09" ; + ] ; + asc:changes [ + asc:addition "Added as_string method." ; + ] ; + . + + +<http://kasei.us/code/files/IRI-0.001.tar.gz> + dcterms:isVersionOf my:project ; + + doap:Version [ + doap:revision "0.001" ; + doap:created "2014-08-02" ; + ] ; + asc:changes [ + asc:addition "First release." ; +# asc:update "" ; + ] ; + . + + +my:project + a doap:Project ; + doap:name "IRI" ; + doap:shortdesc "A Perl implementation of Internationalized Resource Identifiers (IRIs)"@en ; + doap:programming-language "Perl" ; + doap:homepage <http://search.cpan.org/dist/IRI/> ; + doap:download-page <http://search.cpan.org/dist/IRI/> ; + doap:bug-database <http://rt.cpan.org/Dist/Display.html?Queue=IRI> ; + doap:maintainer <http://kasei.us/about/foaf.xrdf#greg> ; + doap:developer <http://kasei.us/about/foaf.xrdf#greg> ; + doap:documenter <http://kasei.us/about/foaf.xrdf#greg> ; + doap:tester <http://kasei.us/about/foaf.xrdf#greg> ; + doap:created "2014-07-23"^^xsd:date ; + doap:license <http://dev.perl.org/licenses/> ; + . + +<http://kasei.us/about/foaf.xrdf#greg> + a foaf:Person ; + foaf:name "Gregory Todd Williams" ; + foaf:homepage <http://kasei.us/> ; + foaf:page <http://search.cpan.org/~gwilliams/> ; + foaf:mbox <mailto:[email protected]> ; + <http://www.w3.org/2002/07/owl#sameAs> <http://purl.org/NET/cpan-uri/person/gwilliams> ; + . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/t/00-simple.t new/IRI-0.011/t/00-simple.t --- old/IRI-0.010/t/00-simple.t 2014-08-07 09:13:45.000000000 +0200 +++ new/IRI-0.011/t/00-simple.t 2020-02-11 06:23:06.000000000 +0100 @@ -77,5 +77,28 @@ is($i->as_string, 'baz/quux', 'IRI string on relative IRI'); } +{ + my $iri = IRI->new( + 'resolved_components' => { + 'scheme' => 'http', + 'path' => '/', + 'host' => 'example.com' + }, + ); + is($iri->abs, 'http://example.com/', 'IRI construction by components'); +} + +{ + my $iri = IRI->new( + lazy => 1, + 'resolved_components' => { + 'scheme' => 'http', + 'path' => '/', + 'host' => 'example.com' + }, + ); + is($iri->abs, 'http://example.com/', 'lazy IRI construction by components'); +} + done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/t/base_resolution.t new/IRI-0.011/t/base_resolution.t --- old/IRI-0.010/t/base_resolution.t 1970-01-01 01:00:00.000000000 +0100 +++ new/IRI-0.011/t/base_resolution.t 2020-02-11 06:23:03.000000000 +0100 @@ -0,0 +1,68 @@ +#!/usr/bin/perl + +use v5.14; +use strict; +use warnings; +no warnings 'redefine'; +use Test::More; +use Data::Dumper; +use Encode qw(decode_utf8); +use URI; +use utf8; + +binmode(\*STDOUT, ':utf8'); + +use IRI; + +sub confirm_tests { + my $base = URI->new(shift->abs); + my $b = $base->as_string; + my $tests = shift; + while (my ($url, $expect) = each %$tests) { + my $u = URI->new_abs($url, $base)->as_string; + is($u, $expect, "CONFIRM: $url [$b]"); + } +} + +sub run_tests { + my $base = shift; + my $b = $base->abs; + my $tests = shift; + while (my ($url, $expect) = each %$tests) { + my $i = IRI->new(value => $url, base => $base); + is($i->abs, $expect, "$url [$b]"); + } +} + +subtest 'base resolution tests from rfc3986 5.4.1' => sub { + my $base = IRI->new(value => "http://a/b/c/d;p?q"); + my %REL_TESTS = ( + "g:h" => "g:h", + "g" => "http://a/b/c/g", + "./g" => "http://a/b/c/g", + "g/" => "http://a/b/c/g/", + "/g" => "http://a/g", + "//g" => "http://g", + "?y" => "http://a/b/c/d;p?y", + "g?y" => "http://a/b/c/g?y", + "#s" => "http://a/b/c/d;p?q#s", + "g#s" => "http://a/b/c/g#s", + "g?y#s" => "http://a/b/c/g?y#s", + ";x" => "http://a/b/c/;x", + "g;x" => "http://a/b/c/g;x", + "g;x?y#s" => "http://a/b/c/g;x?y#s", + "" => "http://a/b/c/d;p?q", + "." => "http://a/b/c/", + "./" => "http://a/b/c/", + ".." => "http://a/b/", + "../" => "http://a/b/", + "../g" => "http://a/b/g", + "../.." => "http://a/", + "../../" => "http://a/", + "../../g" => "http://a/g", + ); + run_tests($base, \%REL_TESTS); + confirm_tests($base, \%REL_TESTS); +}; + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IRI-0.010/t/rel.t new/IRI-0.011/t/rel.t --- old/IRI-0.010/t/rel.t 1970-01-01 01:00:00.000000000 +0100 +++ new/IRI-0.011/t/rel.t 2020-02-11 06:37:44.859577068 +0100 @@ -0,0 +1,141 @@ +#!/usr/bin/perl + +use v5.14; +use strict; +use warnings; +no warnings 'redefine'; +use Test::More; +use Data::Dumper; +use Encode qw(decode_utf8); +use URI; +use utf8; + +binmode(\*STDOUT, ':utf8'); + +use IRI; + +sub confirm_tests { + my $base = URI->new(shift->abs); + my $b = $base->as_string; + my $tests = shift; + my @tests = @$tests; + while (my ($url, $expect) = splice(@tests, 0, 2, ())) { + my $i = URI->new($url); + my $r = $i->rel($base); + my $u = URI->new_abs($expect, $base)->as_string; + is($u, $url, "CONFIRM: $url [$b]"); + } +} + +sub run_tests { + my $base = shift; + my $b = $base->abs; + my $tests = shift; + my @tests = @$tests; + while (my ($url, $expect) = splice(@tests, 0, 2, ())) { + my $i = IRI->new(value => $url); + my $r = $i->rel($base); +# warn "Turning " . $i->abs . " into a relative IRI using base $b ===> " . $r->abs; + is($r->as_string, $expect, "$url [$b]"); + } +} + +subtest 'rel: scheme,host' => sub { + my $base = IRI->new(value => "http://www.example.org/"); + my @REL_TESTS = ( + 'http://www.example.com/' => '//www.example.com/', + 'https://www.example.org/' => 'https://www.example.org/', + 'http://www.example.org/' => '', + 'http://www.example.org/foo' => 'foo', + 'http://www.example.org/foo/bar' => 'foo/bar', + 'http://www.example.org/#hello' => '#hello', + 'http://www.example.org/?query' => '?query', + 'http://www.example.org/foo?query' => 'foo?query', + ); + run_tests($base, \@REL_TESTS); + confirm_tests($base, \@REL_TESTS); +}; + +subtest 'rel: scheme,host,path' => sub { + my $base = IRI->new(value => "http://www.example.org/foo/bar"); + my @REL_TESTS = ( + 'http://www.example.com/' => '//www.example.com/', + 'https://www.example.org/' => 'https://www.example.org/', + 'http://www.example.org/' => '../', + 'http://www.example.org/foo' => '../foo', + 'http://www.example.org/foo/bar' => '', + 'http://www.example.org/#hello' => '../#hello', + 'http://www.example.org/?query' => '../?query', + ); + run_tests($base, \@REL_TESTS); + confirm_tests($base, \@REL_TESTS); +}; + +subtest 'rel: scheme,host,path 2' => sub { + my $base = IRI->new(value => "http://xmlns.com/foaf/0.1/"); + my @REL_TESTS = ( + 'http://xmlns.com/foaf/0.1/name' => 'name', + ); + run_tests($base, \@REL_TESTS); + confirm_tests($base, \@REL_TESTS); +}; + +subtest 'tests derived from rfc3986 5.4.1' => sub { + my $base = IRI->new(value => "http://a/b/c/d;p?q"); + my @REL_TESTS = ( + "g:h" => "g:h", + "http://a/b/c/g" => "g", + "http://a/b/c/g/" => "g/", + "http://a/g" => "/g", + "http://g" => "//g", + "http://a/b/c/d;p?y" => "?y", + "http://a/b/c/g?y" => "g?y", + "http://a/b/c/d;p?q#s" => "#s", + "http://a/b/c/g#s" => "g#s", + "http://a/b/c/g?y#s" => "g?y#s", + "http://a/b/c/;x" => ";x", + "http://a/b/c/g;x" => "g;x", + "http://a/b/c/g;x?y#s" => "g;x?y#s", + "http://a/b/c/d;p?q" => "", + "http://a/b/c/" => "./", + "http://a/b/" => "../", + "http://a/b/g" => "../g", + "http://a/" => "../../", + "http://a/g" => "/g", + ); + run_tests($base, \@REL_TESTS); + confirm_tests($base, \@REL_TESTS); +}; + +subtest 'rel: scheme,host,path,query' => sub { + my $base = IRI->new(value => "http://example.org/sparql?query=ASK%7B%7D%0A"); + my @REL_TESTS = ( + 'http://example.org/sparql#defaultGraph' => 'sparql#defaultGraph', + ); + run_tests($base, \@REL_TESTS); + confirm_tests($base, \@REL_TESTS); +}; + +subtest 'http relative IRI construction with different bases' => sub { + my $iri = IRI->new(value => 'http://example.org:80/foo/bar/baz#xyz?q=ff'); + + my $base0 = IRI->new(value => 'http://example.org/'); + my $base1 = IRI->new(value => 'http://example.org:80/foo'); + my $base2 = IRI->new(value => 'http://example.org:80/foo/'); + my $base3 = IRI->new(value => 'http://example.org:80/foo/ba'); + my $base4 = IRI->new(value => 'http://example.org:80/foo/bar/?q=ff'); + my $base5 = IRI->new(value => 'https://example.org:80/foo/bar/baz'); + my $base6 = IRI->new(value => 'http://example.com:80/foo/bar/baz'); + my $base7 = IRI->new(value => 'http://example.org:81/foo/bar/baz'); + + is($iri->rel($base0)->abs, '//example.org:80/foo/bar/baz#xyz?q=ff', 'different port'); + is($iri->rel($base1)->abs, 'foo/bar/baz#xyz?q=ff', '/foo'); + is($iri->rel($base2)->abs, 'bar/baz#xyz?q=ff', '/bar'); + is($iri->rel($base3)->abs, 'bar/baz#xyz?q=ff', '/foo/ba (shared prefix, but ending mid-path)'); + is($iri->rel($base4)->abs, 'baz#xyz?q=ff', 'extra query'); + is($iri->rel($base5)->abs, 'http://example.org:80/foo/bar/baz#xyz?q=ff', 'different scheme'); + is($iri->rel($base6)->abs, '//example.org:80/foo/bar/baz#xyz?q=ff', 'different host'); + is($iri->rel($base7)->abs, '//example.org:80/foo/bar/baz#xyz?q=ff', 'different port'); +}; + +done_testing();
