aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/turtle/main.ml54
1 files changed, 39 insertions, 15 deletions
diff --git a/test/turtle/main.ml b/test/turtle/main.ml
index fa75377..e299132 100644
--- a/test/turtle/main.ml
+++ b/test/turtle/main.ml
@@ -135,6 +135,10 @@ let object_test_case =
"xsd:string",
Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string"
|> (fun iri -> Obj_iri iri) ;
+ (* Iri *)
+ ":q",
+ Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "q"
+ |> (fun iri -> Obj_iri iri) ;
(* Blank_node *)
"_:string",
Obj_blank_node (Blank_node.of_string "string") ;
@@ -159,7 +163,7 @@ let object_test_case =
) ;
(* BNodePlist *)
"[ foaf:name \"Bob\" ]",
- Obj_BnodPs (BNodePs ([ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "foaf" "name",
+ Obj_BnodPs (BnodPs ([ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "foaf" "name",
[ Obj_literal ( Literal.make
("Bob")
(Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string"))
@@ -180,14 +184,19 @@ let object_test_case =
let bnodeps_test_case =
let cases = [
"[ foaf:name \"Bob\" ]",
- BNodePs ([ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "foaf" "name",
- [ Obj_literal ( Literal.make
- ("Bob")
- (Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string"))
- ]
- ])
+ BnodPs ([ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "foaf" "name",
+ [ Obj_literal ( Literal.make
+ ("Bob")
+ (Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string"))
+ ]
+ ])
;
- ] in
+ "[:p :WWWW]",
+ BnodPs ([ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "p",
+ [ Obj_iri (Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "WWWW"); ] ; ]
+ );
+ ]
+ in
test_case "bnodeps" `Quick
(fun () ->
List.iter
@@ -200,6 +209,10 @@ let bnodeps_test_case =
let predobjs_test_case =
let cases = [
+ ":p :WWWWWWWWWWWWWWWWWWWwwW",
+ [ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "p",
+ [ Obj_iri (Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "WWWWWWWWWWWWWWWWWWWwwW"); ] ; ]
+ ;
" foaf:name \"Bob\" ",
[ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "foaf" "name",
[ Obj_literal ( Literal.make
@@ -226,7 +239,7 @@ let predobjs_test_case =
(Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string")
~language:"ru");
]
- ]
+ ] ;
] in
test_case "predobjs" `Quick
(fun () ->
@@ -244,18 +257,29 @@ let subject_test_case =
"<http://one.example/>",
Sub_iri (Iri.of_iriref (Iriref.of_string "http://one.example/"));
(* Collection *)
- "(1 [:p :q] ( 2 ) )",
+ "(\"1\" [:p :q] ( \"2\" ) )",
Sub_coll (
Collection (
[
Obj_literal (
Literal.make
- ("apple")
- (Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string")) ;
- Obj_literal (
- Literal.make
- ("banana")
+ ("1")
(Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string")) ;
+ Obj_BnodPs (
+ BnodPs (
+ [ Predicate.of_iri @@ Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "p",
+ [ Obj_iri (Iri.of_prefixed_name @@ Prefixed_name.of_strings "" "q"); ] ; ]
+ )
+ ) ;
+ Obj_coll (
+ Collection (
+ [ Obj_literal (
+ Literal.make
+ ("2")
+ (Iri.of_prefixed_name @@ Prefixed_name.of_strings "xsd" "string")) ;
+ ]
+ )
+ )
]
)
) ;