From 2d0ce6252c94cf23477478b35b39466aa120b7cc Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 12 Sep 2026 01:20:42 +0000 Subject: Directory and registry ergonomics --- test/integration/Registration.ml | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'test') diff --git a/test/integration/Registration.ml b/test/integration/Registration.ml index c77a139..f9d865f 100644 --- a/test/integration/Registration.ml +++ b/test/integration/Registration.ml @@ -7,36 +7,19 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) = module I = Kernel.Initialization.Make (S) module B = Kernel.Branch.Make (S) - module Error = struct - open Concepts.Condition - - let not_found () = condition "not-found" "An expected object was not present" empty - end - let run conn = let open Utilities.Result in - let open Protocols in - let registration = - begin - let* root = I.initialize conn in - let* bm = Kernel.Path.(lookup root ("branch" @/ this)) - |> fmap (Option.to_result ~none:(Error.not_found ())) in - let* bm = Registry.from bm |> Option.to_result ~none:(Error.not_found ()) in - let* branch = B.make conn in - Registry.update bm "master" None (Some branch) - end - |> Helpers.condition_as_failure in - let presence = - begin - let* root = I.initialize conn in - let* bm = Kernel.Path.(lookup root ("branch" @/ this)) - |> fmap (Option.to_result ~none:(Error.not_found ())) in - let* bm = Directory.from bm |> Option.to_result ~none:(Error.not_found ()) in - Directory.find bm "master" |> Result.map Option.is_some - end - |> Helpers.condition_as_failure in - check bool "" true registration; - check bool "" true presence + begin + let* root = I.initialize conn in + let* branch = B.make conn in + Kernel.Path.(update root ("branch" @/ this) "master" None (Some branch)) + end + |> Helpers.condition_as_failure |> ignore; + begin + let* root = I.initialize conn in + Kernel.Path.(lookup' root ("branch" @/ "master" @/ "multigroup" @/ this)) + end + |> Helpers.condition_as_failure |> ignore let suite prefix = ( "registration/" ^ prefix, -- cgit v1.2.3