summaryrefslogtreecommitdiff
path: root/test/load.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/load.ml')
-rw-r--r--test/load.ml20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/load.ml b/test/load.ml
index ebc4e15..e992e32 100644
--- a/test/load.ml
+++ b/test/load.ml
@@ -2,8 +2,9 @@ let name = __FILE__
let description =
"Insert two rows of the given content, load them as values with [Value.load] \
- and print them with [Value.pp]. The configuration is read on the standard \
- input"
+ and print them with [Value.pp]; then load the first row again with \
+ [~multivalued:false], which reads only the row itself. The configuration is \
+ read on the standard input"
let speclist () = []
@@ -30,7 +31,20 @@ let exec : string list -> t = function
Lwt.return
[ Format.sprintf "row %Ld:" id; Format.asprintf "%a" Value.pp v ]
in
+ let load_one_partial id =
+ let* v =
+ Value.load db ~multivalued:false
+ (Model.Reference.of_content content)
+ id
+ in
+ Lwt.return
+ [
+ Format.sprintf "row %Ld (without multivalued fields):" id;
+ Format.asprintf "%a" Value.pp v;
+ ]
+ in
let* lines1 = load_one id1 in
let* lines2 = load_one id2 in
- Lwt.return (lines1 @ lines2))
+ let* lines3 = load_one_partial id1 in
+ Lwt.return (lines1 @ lines2 @ lines3))
| _ -> failwith "Invalid arguments"