aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarie <arie@alleycat.cc>2021-06-07 12:36:46 +0200
committerarie <arie@alleycat.cc>2021-06-28 21:02:44 +0200
commit23adcf64b873ad6b0c97d288e4066786faf96c32 (patch)
tree584903687e73c31a68ded1bae86cae0bf5aa4bde
parent8bb06986550c075d9120e0a3619b3e7af01b2871 (diff)
Small change in predobjs parser
-rw-r--r--lib/turtle/rdf_turtle.ml2
-rw-r--r--test/turtle/main.ml30
2 files changed, 10 insertions, 22 deletions
diff --git a/lib/turtle/rdf_turtle.ml b/lib/turtle/rdf_turtle.ml
index a468db9..4ddacc8 100644
--- a/lib/turtle/rdf_turtle.ml
+++ b/lib/turtle/rdf_turtle.ml
@@ -418,7 +418,7 @@ module Parser = struct
lift2
(fun p objs -> (p, objs))
(whitespace *> predicate <* whitespace)
- (sep_by1 comma object')
+ (sep_by1 comma (whitespace *> object' <* whitespace))
)
)
diff --git a/test/turtle/main.ml b/test/turtle/main.ml
index c2c3b86..ea13811 100644
--- a/test/turtle/main.ml
+++ b/test/turtle/main.ml
@@ -185,6 +185,14 @@ let object_test_case =
let bnodeps_test_case =
let cases = [
+ "[ foaf:name \"Bob\" ]",
+ Turtle.BNodePs ([ Turtle.Predicate.of_iri @@ Turtle.Iri.of_prefixed_name @@ Turtle.Prefixed_name.of_strings "foaf" "name",
+ [ Turtle.Obj_literal ( Turtle.Literal.make
+ ("Bob")
+ (Turtle.Iri.of_prefixed_name @@ Turtle.Prefixed_name.of_strings "xsd" "string"))
+ ]
+ ])
+ ;
] in
test_case "bnodeps" `Quick
(fun () ->
@@ -217,26 +225,6 @@ let predobjs_test_case =
(Result.ok @@ v))
cases)
-let test_test_case =
- let cases = [
- " foaf:name \"Bob\" ",
- [ Turtle.Predicate.of_iri @@ Turtle.Iri.of_prefixed_name @@ Turtle.Prefixed_name.of_strings "foaf" "name",
- [ Turtle.Obj_literal ( Turtle.Literal.make
- ("Bob")
- (Turtle.Iri.of_prefixed_name @@ Turtle.Prefixed_name.of_strings "xsd" "string"))
- ]
- ]
- ;
- ] in
- test_case "predobjs" `Quick
- (fun () ->
- List.iter
- (fun (enc, v) ->
- check (result Rdf_alcotest.ast_predobjs string)
- "can parse"
- (parse Parser.test_parser enc)
- (Result.ok @@ v))
- cases)
let () =
Alcotest.run "Turtle" [
"Basic parsers", [
@@ -247,7 +235,7 @@ let () =
iri_test_case;
literal_test_case;
predicate_test_case;
-(* object_test_case; *)
+ object_test_case;
bnodeps_test_case;
predobjs_test_case;
]