[Libreoffice-commits] core.git: stoc/test

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 23 19:12:42 UTC 2019


 stoc/test/uriproc/test_uriproc.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit c4c2e14b1b2cbd234772ca6f2be2a85528b6bc13
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Aug 22 10:34:59 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Aug 23 21:11:38 2019 +0200

    Clarify a corner case
    
    Change-Id: I98c29cbdb701f00fa73f9c8107fb4349b48a564e
    Reviewed-on: https://gerrit.libreoffice.org/78015
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/stoc/test/uriproc/test_uriproc.cxx b/stoc/test/uriproc/test_uriproc.cxx
index 918cd1af1a15..b601eb3a1e04 100644
--- a/stoc/test/uriproc/test_uriproc.cxx
+++ b/stoc/test/uriproc/test_uriproc.cxx
@@ -979,7 +979,17 @@ void Test::testMakeAbsolute() {
           css::uri::RelativeUriExcessParentSegments_REMOVE, "scheme://a#s2" },
 
         { "schema://a", "schema://b/c/../d", true, css::uri::RelativeUriExcessParentSegments_REMOVE,
-          "schema://b/d" } };
+          "schema://b/d" },
+
+        // Per RFC 3986 Section 5.2.1 "Pre-parse the Base URI", "Normalization of the base URI
+        // [...; esp. dot-segment removal per Section 6.2.2.3 "Path Segment Normalization"] is
+        // optional" (and not done by our implemenation), so if the relative URI has no scheme and
+        // no authority and an empty path, the Base URI's path is used unmodified per Section 5.2.2
+        // "Transform References" and thus still contains dot-segments:
+        { "scheme:/a/../b/c", "", true, css::uri::RelativeUriExcessParentSegments_REMOVE,
+          "scheme:/a/../b/c" },
+        { "scheme:/a/../b/c", "d", true, css::uri::RelativeUriExcessParentSegments_REMOVE,
+          "scheme:/b/d" } };
     for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
         css::uno::Reference< css::uri::XUriReference > baseUriRef(
             m_uriFactory->parse(


More information about the Libreoffice-commits mailing list