diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-09-03 02:23:27 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-09-03 02:23:51 +0000 |
| commit | 1259773fac4d7c334351c61ab8cf71231c1af4ef (patch) | |
| tree | 941d59334c04c1f4794ef16e4904cb7dafaa6b72 /test/integration/Registration.ml | |
| parent | cad153992e5ead450ae8245e518c6c88fe778ac1 (diff) | |
| download | RNT-1259773fac4d7c334351c61ab8cf71231c1af4ef.tar.gz RNT-1259773fac4d7c334351c61ab8cf71231c1af4ef.zip | |
Branch registration
Diffstat (limited to 'test/integration/Registration.ml')
| -rw-r--r-- | test/integration/Registration.ml | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/test/integration/Registration.ml b/test/integration/Registration.ml index 8e7ef56..1f1a768 100644 --- a/test/integration/Registration.ml +++ b/test/integration/Registration.ml @@ -5,11 +5,38 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) = module H = Helpers.Storage.Make (S) (C) 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 _root = I.initialize conn |> Helpers.condition_as_failure in - () + let open Utilities.Result in + let open Protocols in + let registration = + begin + let* root = I.initialize conn in + let* root = Directory.from root |> Option.to_result ~none:(Error.not_found ()) in + let* bm = Directory.find root "branch" |> 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* root = Directory.from root |> Option.to_result ~none:(Error.not_found ()) in + let* bm = Directory.find root "branch" |> 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 let suite prefix = ( "registration/" ^ prefix, |
