From 2c500b00e821c11aa9d5c86985e6adc2b59572a9 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 31 Oct 2026 03:17:49 -0300 Subject: share the condition check and employee fixture across tests --- test/integration/Karuta.ml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'test/integration') diff --git a/test/integration/Karuta.ml b/test/integration/Karuta.ml index 2b02e69..f03e25e 100644 --- a/test/integration/Karuta.ml +++ b/test/integration/Karuta.ml @@ -80,11 +80,6 @@ let titles batch = |> List.map (fun {Concepts.Tuple.attributes; _} -> Concepts.Value.to_string (BatMap.String.find "title" attributes) ) -let fails_with name = function - | Ok _ -> fail ("expected " ^ name) - | Error c -> - check bool name true (BatString.starts_with (Concepts.Condition.to_string_hum c) name) - let reads_in_batches node = let batches = begin @@ -164,12 +159,12 @@ let reads_a_program_of_no_path ({root; image} as node) = ["C. J. Date"; "Donald Knuth"; "Harold Abelson"; "Richard Mitchell"] ) let a_missing_function_fails node = - fails_with "beam-failed" + Helpers.refuses "a missing function fails the call" "beam-failed" (Result.bind (run node "library" "nope" ["title"]) (fun relation -> Protocols.Handle.releasing relation (fun () -> Protocols.Relation.read relation) ) ) let a_malformed_term_is_refused {root; _} = - fails_with "malformed-beam-program" + Helpers.refuses "a term that is not a program is refused" "malformed-beam-program" (Kernel.Program.load root ~evaluator:"karuta:beam" ~source:"not a term") let suites () = -- cgit v1.2.3