aboutsummaryrefslogtreecommitdiff
path: root/test/turtle/main.ml
diff options
context:
space:
mode:
authorarie <arie@alleycat.cc>2021-06-07 17:01:06 +0200
committerarie <arie@alleycat.cc>2021-06-28 21:02:45 +0200
commit933fde01c878fbe20952c05ad700fecd0c0286ef (patch)
treeaea60c41b1f57305ad3a68c20e6fb205547f286e /test/turtle/main.ml
parent618d4dc294d0613de8747a2b14aec89429958b8a (diff)
Rdf turtle
add test for directive, improved types, added some pp and equal functions.
Diffstat (limited to 'test/turtle/main.ml')
-rw-r--r--test/turtle/main.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/turtle/main.ml b/test/turtle/main.ml
index 6ada3e4..d70ca4e 100644
--- a/test/turtle/main.ml
+++ b/test/turtle/main.ml
@@ -237,6 +237,21 @@ let predobjs_test_case =
(Result.ok @@ v))
cases)
+let directive_test_case =
+ let cases = [
+ "@base <http://one.example/> .",
+ Turtle.Directive.of_iriref (Turtle.Iriref.of_string "http://one.example/")
+ ] in
+ test_case "directive" `Quick
+ (fun () ->
+ List.iter
+ (fun (enc, v) ->
+ check (result Rdf_alcotest.ast_directive string)
+ "can parse"
+ (parse Parser.directive enc)
+ (Result.ok @@ v))
+ cases)
+
let () =
Alcotest.run "Turtle" [
"Basic parsers", [
@@ -250,5 +265,6 @@ let () =
object_test_case;
bnodeps_test_case;
predobjs_test_case;
+ directive_test_case;
]
]