From f93c3fdd6c7d6ca61bec55d3c1ffae7e7c793913 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 29 Mar 2023 19:59:50 -0400 Subject: Fix relative URI creation --- test/pretty/manifest.ttl | 7 +++++++ test/pretty/relative-uris.ttl | 2 ++ test/root/root-inside-base-out.ttl | 4 ++-- test/root/root-outside-base-out.ttl | 4 ++-- test/test_uri.c | 13 ------------- 5 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 test/pretty/relative-uris.ttl (limited to 'test') diff --git a/test/pretty/manifest.ttl b/test/pretty/manifest.ttl index 1f653d65..69b951af 100644 --- a/test/pretty/manifest.ttl +++ b/test/pretty/manifest.ttl @@ -32,6 +32,7 @@ <#many-objects> <#named-graph> <#nested-list-object> + <#relative-uris> <#short-string-escapes> <#uri-escapes> <#nested-list-subject> @@ -193,6 +194,12 @@ mf:name "nested-list-subject" ; mf:result . +<#relative-uris> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "relative-uris" ; + mf:result . + <#short-string-escapes> a rdft:TestTurtleEval ; mf:action ; diff --git a/test/pretty/relative-uris.ttl b/test/pretty/relative-uris.ttl new file mode 100644 index 00000000..397c7cf7 --- /dev/null +++ b/test/pretty/relative-uris.ttl @@ -0,0 +1,2 @@ + + . diff --git a/test/root/root-inside-base-out.ttl b/test/root/root-inside-base-out.ttl index a5081e4d..76f61791 100644 --- a/test/root/root-inside-base-out.ttl +++ b/test/root/root-inside-base-out.ttl @@ -1,7 +1,7 @@ @base . @prefix rdfs: . - +<> rdfs:label "base node" . @@ -10,7 +10,7 @@ rdfs:label "within root" . - + rdfs:label "within base" . diff --git a/test/root/root-outside-base-out.ttl b/test/root/root-outside-base-out.ttl index 47a4c47e..dcb95d5a 100644 --- a/test/root/root-outside-base-out.ttl +++ b/test/root/root-outside-base-out.ttl @@ -4,7 +4,7 @@ <> rdfs:label "base node" . - +<../> rdfs:label "root node" . @@ -13,7 +13,7 @@ <../s> rdfs:label "within root" . -<../../s> + rdfs:label "outside root" . diff --git a/test/test_uri.c b/test/test_uri.c index bcd670e5..ac24a2be 100644 --- a/test/test_uri.c +++ b/test/test_uri.c @@ -265,12 +265,8 @@ test_relative_uri(void) // Related base - /* Expected: check_relative_uri( "http://example.org/a/b", "http://example.org/", NULL, "a/b"); - Actual: */ - check_relative_uri( - "http://example.org/a/b", "http://example.org/", NULL, "/a/b"); check_relative_uri( "http://example.org/a/b", "http://example.org/a/", NULL, "b"); @@ -286,10 +282,7 @@ test_relative_uri(void) check_relative_uri("http://example.org/", "http://example.org/", NULL, ""); - /* Expected: check_relative_uri("http://example.org/", "http://example.org/a", NULL, ""); - Actual: */ - check_relative_uri("http://example.org/", "http://example.org/a", NULL, "/"); check_relative_uri( "http://example.org/", "http://example.org/a/", NULL, "../"); @@ -337,10 +330,7 @@ test_relative_uri(void) check_relative_uri("http://example.org/a/", "http://example.org/a/", "http://example.org/a/", - /* Expected: ""); - Actual: */ - "http://example.org/a/"); check_relative_uri("http://example.org/a/b", "http://example.org/a/b/c", @@ -350,10 +340,7 @@ test_relative_uri(void) check_relative_uri("http://example.org/a", "http://example.org/a/b/c", "http://example.org/a/b", - /* Expected: "http://example.org/a"); - Actual: */ - "../../a"); } int -- cgit v1.2.1