diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 03:17:49 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 03:17:49 -0300 |
| commit | 2c500b00e821c11aa9d5c86985e6adc2b59572a9 (patch) | |
| tree | ade8f8018b40294649d9105a9b85dd560bf3b49e /test/Helpers.ml | |
| parent | 55174a28581c33c4b6d91066086a2ee7b5c663ea (diff) | |
| download | RNT-2c500b00e821c11aa9d5c86985e6adc2b59572a9.tar.gz RNT-2c500b00e821c11aa9d5c86985e6adc2b59572a9.zip | |
share the condition check and employee fixture across tests
Diffstat (limited to 'test/Helpers.ml')
| -rw-r--r-- | test/Helpers.ml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Helpers.ml b/test/Helpers.ml index ecd3985..5f4478f 100644 --- a/test/Helpers.ml +++ b/test/Helpers.ml @@ -15,6 +15,19 @@ let condition_as_failure = function | Ok r -> r | Error c -> Alcotest.fail (Concepts.Condition.to_string_hum c) +let refuses message name result = + Alcotest.(check bool) + message true + ( match result with + | Error c -> BatString.starts_with (Concepts.Condition.to_string_hum c) name + | Ok _ -> false ) + +let employee name age = + { Concepts.Tuple.type_= "employee"; + attributes= + BatMap.String.of_list ["name", Concepts.Value.String name; "age", Concepts.Value.Integer age] + } + let pp_value ppf v = Format.pp_print_string ppf (Concepts.Value.to_string v) let value = Alcotest.testable pp_value Concepts.Value.equal |
