From 565b3ed5c270b37ebf096ce9e8a82a6b6f611125 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 28 Jun 2022 21:24:53 -0400 Subject: [PATCH] compat with 4.03 --- src/cbor/tests/t_appendix_a.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cbor/tests/t_appendix_a.ml b/src/cbor/tests/t_appendix_a.ml index 47f662bc..16958b10 100644 --- a/src/cbor/tests/t_appendix_a.ml +++ b/src/cbor/tests/t_appendix_a.ml @@ -28,6 +28,7 @@ module Test = struct self.hex pp_expect self.expect self.roundtrip end + let list_assoc_opt x l = try Some (List.assoc x l) with _ -> None let extract_tests (j:json) : Test.t list = let l = J.Util.to_list j in @@ -37,7 +38,7 @@ let extract_tests (j:json) : Test.t list = let raw = CCString.of_hex_exn @@ hex in let roundtrip = J.Util.to_bool @@ List.assoc "roundtrip" o in let expect = - match List.assoc_opt "decoded" o, List.assoc_opt "diagnostic" o with + match list_assoc_opt "decoded" o, list_assoc_opt "diagnostic" o with | None, Some (`String s) -> Test.Diagnostic s | Some o, _ -> Test.Decoded o | _ -> failwith "cannot find expected result"