From 4f7445104ae144fb6e599fd97bb4fe4feefb754c Mon Sep 17 00:00:00 2001 From: Tpt Date: Sun, 30 Jul 2023 17:17:52 +0200 Subject: [PATCH] Testsuite: Upgrades to new RDF syntax test structure --- testsuite/benches/parser.rs | 4 +- testsuite/rdf-star | 2 +- testsuite/rdf-tests | 2 +- testsuite/src/files.rs | 6 +-- testsuite/tests/canonicalization.rs | 2 +- testsuite/tests/parser.rs | 71 +++++++++++++++++------------ 6 files changed, 49 insertions(+), 38 deletions(-) diff --git a/testsuite/benches/parser.rs b/testsuite/benches/parser.rs index ed7205eb..c14fb921 100644 --- a/testsuite/benches/parser.rs +++ b/testsuite/benches/parser.rs @@ -23,14 +23,14 @@ fn test_data_from_testsuite(manifest_uri: String, include_tests_types: &[&str]) fn ntriples_test_data() -> Result> { test_data_from_testsuite( - "http://w3c.github.io/rdf-tests/ntriples/manifest.ttl".to_owned(), + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-n-triples/manifest.ttl".to_owned(), &["http://www.w3.org/ns/rdftest#TestNTriplesPositiveSyntax"], ) } fn turtle_test_data() -> Result> { test_data_from_testsuite( - "http://w3c.github.io/rdf-tests/turtle/manifest.ttl".to_owned(), + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-turtle/manifest.ttl".to_owned(), &[ "http://www.w3.org/ns/rdftest#TestTurtlePositiveSyntax", "http://www.w3.org/ns/rdftest#TestTurtleEval", diff --git a/testsuite/rdf-star b/testsuite/rdf-star index 8c7039dd..59eb0293 160000 --- a/testsuite/rdf-star +++ b/testsuite/rdf-star @@ -1 +1 @@ -Subproject commit 8c7039dd152915a48f266c3d9a10c75adeb24181 +Subproject commit 59eb0293b2b620023ee38252228c725769ad206f diff --git a/testsuite/rdf-tests b/testsuite/rdf-tests index fb410326..aaa24e47 160000 --- a/testsuite/rdf-tests +++ b/testsuite/rdf-tests @@ -1 +1 @@ -Subproject commit fb41032699d22b9991bba2e427b805b3b82648b6 +Subproject commit aaa24e4729a89bdee004bc3042814159eb689a19 diff --git a/testsuite/src/files.rs b/testsuite/src/files.rs index 9a9dc839..7e4f3b17 100644 --- a/testsuite/src/files.rs +++ b/testsuite/src/files.rs @@ -9,12 +9,8 @@ use std::path::PathBuf; pub fn read_file(url: &str) -> Result { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push(if url.starts_with("http://w3c.github.io/") { - url.replace("http://w3c.github.io/", "") - } else if url.starts_with("https://w3c.github.io/") { + path.push(if url.starts_with("https://w3c.github.io/") { url.replace("https://w3c.github.io/", "") - } else if url.starts_with("http://www.w3.org/2013/RDFXMLTests/") { - url.replace("http://www.w3.org/2013/RDFXMLTests/", "rdf-tests/rdf-xml/") } else if url.starts_with("https://github.com/oxigraph/oxigraph/tests/") { url.replace( "https://github.com/oxigraph/oxigraph/tests/", diff --git a/testsuite/tests/canonicalization.rs b/testsuite/tests/canonicalization.rs index 115e5c5a..c6e5f0e2 100644 --- a/testsuite/tests/canonicalization.rs +++ b/testsuite/tests/canonicalization.rs @@ -3,5 +3,5 @@ use oxigraph_testsuite::check_testsuite; #[test] fn rdf_canon_w3c_testsuite() -> Result<()> { - check_testsuite("http://w3c.github.io/rdf-canon/tests/manifest.ttl", &[]) + check_testsuite("https://w3c.github.io/rdf-canon/tests/manifest.ttl", &[]) } diff --git a/testsuite/tests/parser.rs b/testsuite/tests/parser.rs index e9458256..2846b8f0 100644 --- a/testsuite/tests/parser.rs +++ b/testsuite/tests/parser.rs @@ -2,92 +2,107 @@ use anyhow::Result; use oxigraph_testsuite::check_testsuite; #[test] -fn ntriples_w3c_testsuite() -> Result<()> { - check_testsuite("http://w3c.github.io/rdf-tests/ntriples/manifest.ttl", &[]) +fn rdf11_n_triples_w3c_testsuite() -> Result<()> { + check_testsuite( + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-n-triples/manifest.ttl", + &[], + ) } #[test] -fn nquads_w3c_testsuite() -> Result<()> { - check_testsuite("http://w3c.github.io/rdf-tests/nquads/manifest.ttl", &[]) +fn rdf12_n_triples_syntax_w3c_testsuite() -> Result<()> { + check_testsuite( + "https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-n-triples/syntax/manifest.ttl", + &[], + ) } -#[cfg(not(windows))] // Tests don't like git auto "\r\n" on Windows #[test] -fn turtle_w3c_testsuite() -> Result<()> { - check_testsuite("http://w3c.github.io/rdf-tests/turtle/manifest.ttl", &[]) +fn rdf11_n_quads_w3c_testsuite() -> Result<()> { + check_testsuite( + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-n-quads/manifest.ttl", + &[], + ) } #[cfg(not(windows))] // Tests don't like git auto "\r\n" on Windows #[test] -fn trig_w3c_testsuite() -> Result<()> { - check_testsuite("http://w3c.github.io/rdf-tests/trig/manifest.ttl", &[]) +fn rdf11_turtle_w3c_testsuite() -> Result<()> { + check_testsuite( + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-turtle/manifest.ttl", + &[], + ) } #[test] -fn n3_parser_testsuite() -> Result<()> { +fn rdf12_turtle_syntax_w3c_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/N3/tests/N3Tests/manifest-parser.ttl", + "https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-turtle/syntax/manifest.ttl", &[], ) } + #[test] -fn n3_extended_testsuite() -> Result<()> { +fn rdf12_turtle_eval_w3c_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/N3/tests/N3Tests/manifest-extended.ttl", + "https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-turtle/eval/manifest.ttl", &[], ) } #[cfg(not(windows))] // Tests don't like git auto "\r\n" on Windows #[test] -fn n3_turtle_testsuite() -> Result<()> { +fn rdf11_trig_w3c_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/N3/tests/TurtleTests/manifest.ttl", + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-trig/manifest.ttl", &[], ) } #[test] -fn rdf_xml_w3c_testsuite() -> Result<()> { - check_testsuite("http://www.w3.org/2013/RDFXMLTests/manifest.ttl", &[]) +fn rdf12_trig_syntax_w3c_testsuite() -> Result<()> { + check_testsuite( + "https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-trig/syntax/manifest.ttl", + &[], + ) } #[test] -fn ntriples_star_w3c_testsuite() -> Result<()> { +fn rdf12_trig_eval_w3c_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/rdf-star/tests/nt/syntax/manifest.ttl", + "https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-trig/eval/manifest.ttl", &[], ) } #[test] -fn turtle_star_syntax_w3c_testsuite() -> Result<()> { +fn rdf11_xml_w3c_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/rdf-star/tests/turtle/syntax/manifest.ttl", + "https://w3c.github.io/rdf-tests/rdf/rdf11/rdf-xml/manifest.ttl", &[], ) } #[test] -fn turtle_star_eval_w3c_testsuite() -> Result<()> { +fn n3_parser_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/rdf-star/tests/turtle/eval/manifest.ttl", + "https://w3c.github.io/N3/tests/N3Tests/manifest-parser.ttl", &[], ) } - #[test] -fn trig_star_syntax_w3c_testsuite() -> Result<()> { +fn n3_extended_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/rdf-star/tests/trig/syntax/manifest.ttl", + "https://w3c.github.io/N3/tests/N3Tests/manifest-extended.ttl", &[], ) } +#[cfg(not(windows))] // Tests don't like git auto "\r\n" on Windows #[test] -fn trig_star_eval_w3c_testsuite() -> Result<()> { +fn n3_turtle_testsuite() -> Result<()> { check_testsuite( - "https://w3c.github.io/rdf-star/tests/trig/eval/manifest.ttl", + "https://w3c.github.io/N3/tests/TurtleTests/manifest.ttl", &[], ) }