aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/normalise/manifest.ttl17
-rw-r--r--tests/normalise/test-normalise.nt69
-rw-r--r--tests/normalise/test-normalise.ttl74
3 files changed, 160 insertions, 0 deletions
diff --git a/tests/normalise/manifest.ttl b/tests/normalise/manifest.ttl
new file mode 100644
index 00000000..75f08ec9
--- /dev/null
+++ b/tests/normalise/manifest.ttl
@@ -0,0 +1,17 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rdft: <http://www.w3.org/ns/rdftest#> .
+
+<>
+ rdf:type mf:Manifest ;
+ rdfs:comment "Serd normalisation test cases" ;
+ mf:entries (
+ <#test-normalise>
+ ) .
+
+<#test-normalise>
+ rdf:type rdft:TestTurtleEval ;
+ mf:name "test-normalise" ;
+ mf:action <test-normalise.ttl> ;
+ mf:result <test-normalise.nt> .
diff --git a/tests/normalise/test-normalise.nt b/tests/normalise/test-normalise.nt
new file mode 100644
index 00000000..e23989ec
--- /dev/null
+++ b/tests/normalise/test-normalise.nt
@@ -0,0 +1,69 @@
+_:b1 <http://example.org/boolean> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/boolean> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/boolean> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/boolean> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/boolean> " ja "^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/boolean> ""^^<http://www.w3.org/2001/XMLSchema#boolean> .
+_:b1 <http://example.org/ieee754> "1.0E2"^^<http://www.w3.org/2001/XMLSchema#float> .
+_:b1 <http://example.org/ieee754> "-1.0E2"^^<http://www.w3.org/2001/XMLSchema#float> .
+_:b1 <http://example.org/ieee754> "1.0E3"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:b1 <http://example.org/ieee754> "-1.0E3"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:b1 <http://example.org/machine> "9223372036854775807"^^<http://www.w3.org/2001/XMLSchema#long> .
+_:b1 <http://example.org/machine> "-9223372036854775808"^^<http://www.w3.org/2001/XMLSchema#long> .
+_:b1 <http://example.org/machine> "2147483647"^^<http://www.w3.org/2001/XMLSchema#int> .
+_:b1 <http://example.org/machine> "-2147483648"^^<http://www.w3.org/2001/XMLSchema#int> .
+_:b1 <http://example.org/machine> "32767"^^<http://www.w3.org/2001/XMLSchema#short> .
+_:b1 <http://example.org/machine> "-32768"^^<http://www.w3.org/2001/XMLSchema#short> .
+_:b1 <http://example.org/machine> "127"^^<http://www.w3.org/2001/XMLSchema#byte> .
+_:b1 <http://example.org/machine> "-128"^^<http://www.w3.org/2001/XMLSchema#byte> .
+_:b1 <http://example.org/machine> "1"^^<http://www.w3.org/2001/XMLSchema#unsignedLong> .
+_:b1 <http://example.org/machine> "18446744073709551615"^^<http://www.w3.org/2001/XMLSchema#unsignedLong> .
+_:b1 <http://example.org/machine> "1"^^<http://www.w3.org/2001/XMLSchema#unsignedInt> .
+_:b1 <http://example.org/machine> "4294967295"^^<http://www.w3.org/2001/XMLSchema#unsignedInt> .
+_:b1 <http://example.org/machine> "1"^^<http://www.w3.org/2001/XMLSchema#unsignedShort> .
+_:b1 <http://example.org/machine> "65535"^^<http://www.w3.org/2001/XMLSchema#unsignedShort> .
+_:b1 <http://example.org/machine> "1"^^<http://www.w3.org/2001/XMLSchema#unsignedByte> .
+_:b1 <http://example.org/machine> "255"^^<http://www.w3.org/2001/XMLSchema#unsignedByte> .
+_:b1 <http://example.org/decimal> "0.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "0.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-0.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "36893488147419103232.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-36893488147419103232.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-36893488147419103232.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> "-0.123"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> " junk 1234.5678 "^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/decimal> " 1234.5678 junk "^^<http://www.w3.org/2001/XMLSchema#decimal> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "-36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "-36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> " junk 987654321 "^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> " 987654321 junk "^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://example.org/integer> "0"^^<http://www.w3.org/2001/XMLSchema#nonPositiveInteger> .
+_:b1 <http://example.org/integer> "-36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#nonPositiveInteger> .
+_:b1 <http://example.org/integer> "-1"^^<http://www.w3.org/2001/XMLSchema#negativeInteger> .
+_:b1 <http://example.org/integer> "-36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#negativeInteger> .
+_:b1 <http://example.org/integer> "0"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
+_:b1 <http://example.org/integer> "1"^^<http://www.w3.org/2001/XMLSchema#positiveInteger> .
+_:b1 <http://example.org/integer> "36893488147419103232"^^<http://www.w3.org/2001/XMLSchema#positiveInteger> .
+_:b1 <http://example.org/other> "untyped" .
+_:b1 <http://example.org/other> <http://example.org/uri> .
+_:b1 <http://example.org/other> "notxsd"^^<http://example.org/sometype> .
+_:b1 <http://example.org/other> "unsupported"^^<http://www.w3.org/2001/XMLSchema#name> .
diff --git a/tests/normalise/test-normalise.ttl b/tests/normalise/test-normalise.ttl
new file mode 100644
index 00000000..3db64f39
--- /dev/null
+++ b/tests/normalise/test-normalise.ttl
@@ -0,0 +1,74 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[
+ <boolean> " false "^^xsd:boolean ,
+ " 0 "^^xsd:boolean ,
+ " true "^^xsd:boolean ,
+ " 1 "^^xsd:boolean ,
+ " ja "^^xsd:boolean ,
+ ""^^xsd:boolean ;
+ <ieee754> " +0100.0 "^^xsd:float ,
+ " -0100.0 "^^xsd:float ,
+ " +01000.0 "^^xsd:double ,
+ " -01000.0 "^^xsd:double ;
+ <machine> " +09223372036854775807 "^^xsd:long ,
+ " -09223372036854775808 "^^xsd:long ,
+ " +02147483647 "^^xsd:int ,
+ " -02147483648 "^^xsd:int ,
+ " +032767 "^^xsd:short ,
+ " -032768 "^^xsd:short ,
+ " +0127 "^^xsd:byte ,
+ " -0128 "^^xsd:byte ,
+ " +01 "^^xsd:unsignedLong ,
+ " 018446744073709551615 "^^xsd:unsignedLong ,
+ " +01 "^^xsd:unsignedInt ,
+ " 04294967295 "^^xsd:unsignedInt ,
+ " +01 "^^xsd:unsignedShort ,
+ " 065535 "^^xsd:unsignedShort ,
+ " +01 "^^xsd:unsignedByte ,
+ " 0255 "^^xsd:unsignedByte ;
+ <decimal> " 00 "^^xsd:decimal ,
+ " +0 "^^xsd:decimal ,
+ " -0 "^^xsd:decimal ,
+ " 36893488147419103232 "^^xsd:decimal ,
+ " 0036893488147419103232 "^^xsd:decimal ,
+ " +36893488147419103232 "^^xsd:decimal ,
+ " +0036893488147419103232 "^^xsd:decimal ,
+ " +0036893488147419103232. "^^xsd:decimal ,
+ " +0036893488147419103232.00 "^^xsd:decimal ,
+ " +0036893488147419103232.12300 "^^xsd:decimal ,
+ " -36893488147419103232 "^^xsd:decimal ,
+ " -0036893488147419103232 "^^xsd:decimal ,
+ " -0036893488147419103232. "^^xsd:decimal ,
+ " -0036893488147419103232.00 "^^xsd:decimal ,
+ " -0036893488147419103232.12300 "^^xsd:decimal ,
+ " 00.12300 "^^xsd:decimal ,
+ " .12300 "^^xsd:decimal ,
+ " +.12300 "^^xsd:decimal ,
+ " +00.12300 "^^xsd:decimal ,
+ " -.12300 "^^xsd:decimal ,
+ " -00.12300 "^^xsd:decimal ,
+ " junk 1234.5678 "^^xsd:decimal ,
+ " 1234.5678 junk "^^xsd:decimal ;
+ <integer> " 36893488147419103232 "^^xsd:integer ,
+ " 0036893488147419103232 "^^xsd:integer ,
+ " +36893488147419103232 "^^xsd:integer ,
+ " +0036893488147419103232 "^^xsd:integer ,
+ " -36893488147419103232 "^^xsd:integer ,
+ " -0036893488147419103232 "^^xsd:integer ,
+ " junk 987654321 "^^xsd:integer ,
+ " 987654321 junk "^^xsd:integer ,
+ " 00 "^^xsd:nonPositiveInteger ,
+ " -036893488147419103232 "^^xsd:nonPositiveInteger ,
+ " -01 "^^xsd:negativeInteger ,
+ " -036893488147419103232 "^^xsd:negativeInteger ,
+ " 00 "^^xsd:nonNegativeInteger ,
+ " 036893488147419103232 "^^xsd:nonNegativeInteger ,
+ " +01 "^^xsd:positiveInteger ,
+ " 036893488147419103232 "^^xsd:positiveInteger ;
+ <other> "untyped" ,
+ <uri> ,
+ "notxsd"^^<sometype> ,
+ "unsupported"^^xsd:name
+] .