aboutsummaryrefslogtreecommitdiffstats
path: root/test/extra
diff options
context:
space:
mode:
Diffstat (limited to 'test/extra')
-rw-r--r--test/extra/canon/bad-boolean.ttl5
-rw-r--r--test/extra/canon/bad-decimal-leading.ttl4
-rw-r--r--test/extra/canon/bad-decimal-trailing.ttl4
-rw-r--r--test/extra/canon/bad-empty-boolean.ttl5
-rw-r--r--test/extra/canon/bad-integer-leading.ttl4
-rw-r--r--test/extra/canon/bad-integer-trailing.ttl4
-rw-r--r--test/extra/canon/bad-lang-long.ttl3
-rw-r--r--test/extra/canon/manifest.ttl65
-rw-r--r--test/extra/canon/test-canon.nt70
-rw-r--r--test/extra/canon/test-canon.ttl76
10 files changed, 240 insertions, 0 deletions
diff --git a/test/extra/canon/bad-boolean.ttl b/test/extra/canon/bad-boolean.ttl
new file mode 100644
index 00000000..c4fc3eb5
--- /dev/null
+++ b/test/extra/canon/bad-boolean.ttl
@@ -0,0 +1,5 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <boolean> " ja "^^xsd:boolean .
+
diff --git a/test/extra/canon/bad-decimal-leading.ttl b/test/extra/canon/bad-decimal-leading.ttl
new file mode 100644
index 00000000..0d18eac7
--- /dev/null
+++ b/test/extra/canon/bad-decimal-leading.ttl
@@ -0,0 +1,4 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <decimal> " junk 1234.5678 "^^xsd:decimal .
diff --git a/test/extra/canon/bad-decimal-trailing.ttl b/test/extra/canon/bad-decimal-trailing.ttl
new file mode 100644
index 00000000..10882ef5
--- /dev/null
+++ b/test/extra/canon/bad-decimal-trailing.ttl
@@ -0,0 +1,4 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <decimal> " 1234.5678 junk "^^xsd:decimal .
diff --git a/test/extra/canon/bad-empty-boolean.ttl b/test/extra/canon/bad-empty-boolean.ttl
new file mode 100644
index 00000000..9a390c46
--- /dev/null
+++ b/test/extra/canon/bad-empty-boolean.ttl
@@ -0,0 +1,5 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <boolean> ""^^xsd:boolean .
+
diff --git a/test/extra/canon/bad-integer-leading.ttl b/test/extra/canon/bad-integer-leading.ttl
new file mode 100644
index 00000000..80c1a6af
--- /dev/null
+++ b/test/extra/canon/bad-integer-leading.ttl
@@ -0,0 +1,4 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <integer> " junk 987654321 "^^xsd:integer .
diff --git a/test/extra/canon/bad-integer-trailing.ttl b/test/extra/canon/bad-integer-trailing.ttl
new file mode 100644
index 00000000..a94a9ec4
--- /dev/null
+++ b/test/extra/canon/bad-integer-trailing.ttl
@@ -0,0 +1,4 @@
+@base <http://example.org/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[] <integer> " 987654321 junk "^^xsd:integer .
diff --git a/test/extra/canon/bad-lang-long.ttl b/test/extra/canon/bad-lang-long.ttl
new file mode 100644
index 00000000..f84df07f
--- /dev/null
+++ b/test/extra/canon/bad-lang-long.ttl
@@ -0,0 +1,3 @@
+@base <http://example.org/> .
+
+[] <tagged> "hello"@ridiculously-long-lang-tag-beyond-even-RFC4646-recommendation .
diff --git a/test/extra/canon/manifest.ttl b/test/extra/canon/manifest.ttl
new file mode 100644
index 00000000..143928ee
--- /dev/null
+++ b/test/extra/canon/manifest.ttl
@@ -0,0 +1,65 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rdft: <http://www.w3.org/ns/rdftest#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:comment "Serd canonical literal writing test suite" ;
+ mf:entries (
+ <#bad-boolean>
+ <#bad-decimal-leading>
+ <#bad-decimal-trailing>
+ <#bad-empty-boolean>
+ <#bad-integer-leading>
+ <#bad-integer-trailing>
+ <#bad-lang-long>
+ <#test-canon>
+ ) .
+
+<#bad-boolean>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::boolean syntax" ;
+ mf:action <bad-boolean.ttl> ;
+ mf:name "bad-boolean" .
+
+<#bad-decimal-leading>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::decimal syntax (leading garbage)" ;
+ mf:action <bad-decimal-leading.ttl> ;
+ mf:name "bad-decimal-leading" .
+
+<#bad-decimal-trailing>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::decimal syntax (trailing garbage)" ;
+ mf:action <bad-decimal-trailing.ttl> ;
+ mf:name "bad-decimal-trailing" .
+
+<#bad-empty-boolean>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::boolean syntax (no value)" ;
+ mf:action <bad-empty-boolean.ttl> ;
+ mf:name "bad-empty-boolean" .
+
+<#bad-integer-leading>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::integer syntax (leading garbage)" ;
+ mf:action <bad-integer-leading.ttl> ;
+ mf:name "bad-integer-leading" .
+
+<#bad-integer-trailing>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Invalid xsd::integer syntax (trailing garbage)" ;
+ mf:action <bad-integer-trailing.ttl> ;
+ mf:name "bad-integer-trailing" .
+
+<#bad-lang-long>
+ a rdft:TestTurtleNegativeEval ;
+ rdfs:comment "Overly long language tag" ;
+ mf:action <bad-lang-long.ttl> ;
+ mf:name "bad-lang-long" .
+
+<#test-canon>
+ a rdft:TestTurtleEval ;
+ mf:action <test-canon.ttl> ;
+ mf:name "test-canon" ;
+ mf:result <test-canon.nt> .
diff --git a/test/extra/canon/test-canon.nt b/test/extra/canon/test-canon.nt
new file mode 100644
index 00000000..ff492890
--- /dev/null
+++ b/test/extra/canon/test-canon.nt
@@ -0,0 +1,70 @@
+_: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/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/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> "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/langString> "no language tag" .
+_:b1 <http://example.org/taggedString> "english"@en-ca .
+_:b1 <http://example.org/time> "P1Y6M"^^<http://www.w3.org/2001/XMLSchema#duration> .
+_:b1 <http://example.org/time> "12:15:01Z"^^<http://www.w3.org/2001/XMLSchema#time> .
+_:b1 <http://example.org/time> "2004-04-12Z"^^<http://www.w3.org/2001/XMLSchema#date> .
+_:b1 <http://example.org/binary> "A1B7F080"^^<http://www.w3.org/2001/XMLSchema#hexBinary> .
+_:b1 <http://example.org/binary> "Zm9vYmF="^^<http://www.w3.org/2001/XMLSchema#base64Binary> .
+_: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/test/extra/canon/test-canon.ttl b/test/extra/canon/test-canon.ttl
new file mode 100644
index 00000000..0d0b4682
--- /dev/null
+++ b/test/extra/canon/test-canon.ttl
@@ -0,0 +1,76 @@
+@base <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+[
+ <boolean> " false "^^xsd:boolean ,
+ " 0 "^^xsd:boolean ,
+ " true "^^xsd:boolean ,
+ " 1 "^^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 ;
+ <integer> " 36893488147419103232 "^^xsd:integer ,
+ " 0036893488147419103232 "^^xsd:integer ,
+ " +36893488147419103232 "^^xsd:integer ,
+ " +0036893488147419103232 "^^xsd:integer ,
+ " -36893488147419103232 "^^xsd:integer ,
+ " -0036893488147419103232 "^^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 ;
+ <langString> "no language tag"^^rdf:langString ;
+ <taggedString> "english"@EN-CA ;
+ <time> " P1Y6M0D "^^xsd:duration ,
+ " 12:15:01+00:00 "^^xsd:time ,
+ " 02004-04-12+00:00 "^^xsd:date ;
+ <binary> "A 1 B7 F080"^^xsd:hexBinary ,
+ " Zm 9v Y m F="^^xsd:base64Binary ;
+ <other> "untyped" ,
+ <uri> ,
+ "notxsd"^^<sometype> ,
+ "unsupported"^^xsd:name
+] .