From 0773ae1c4ee528e1a674954efca2a89249700687 Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Mon, 11 Oct 2021 17:10:58 +0200 Subject: [PATCH] Fix deprecated function from fmt module into tests --- digestif.opam | 4 ++-- test/conv/test_conv.ml | 2 +- test/test.ml | 6 +++--- test/test_runes.ml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/digestif.opam b/digestif.opam index d7e4c95..2371b33 100644 --- a/digestif.opam +++ b/digestif.opam @@ -38,8 +38,8 @@ install: [ ] depends: [ - "ocaml" {>= "4.03.0"} - "dune" {>= "2.6.0"} + "ocaml" {>= "4.05.0"} + "dune" {>= "2.6.0"} "conf-pkg-config" {build} "eqaf" "base-bytes" diff --git a/test/conv/test_conv.ml b/test/conv/test_conv.ml index 98dbb43..f419a83 100644 --- a/test/conv/test_conv.ml +++ b/test/conv/test_conv.ml @@ -6,7 +6,7 @@ let () = Random.full_init seed let () = Fmt.epr "seed: %a.\n%!" Fmt.(Dump.array int) seed -let strf = Fmt.strf +let strf = Fmt.str let invalid_arg = Fmt.invalid_arg diff --git a/test/test.ml b/test/test.ml index 60e4063..2bd857b 100644 --- a/test/test.ml +++ b/test/test.ml @@ -33,7 +33,7 @@ let title : type a k. [ `HMAC | `Digest ] -> k Digestif.hash -> a s -> string = | Bytes -> Fmt.string ppf "bytes" | String -> Fmt.string ppf "string" | Bigstring -> Fmt.string ppf "bigstring" in - Fmt.strf "%a:%a:%a" pp_computation computation pp_hash hash pp_input input + Fmt.str "%a:%a:%a" pp_computation computation pp_hash hash pp_input input let bytes = Bytes @@ -466,7 +466,7 @@ end let str = Alcotest.testable (fun ppf -> Fmt.pf ppf "%S") String.equal let blake2s_spe digest_size = - Alcotest.test_case (Fmt.strf "BLAKE2S (digest-size: %d)" digest_size) `Quick + Alcotest.test_case (Fmt.str "BLAKE2S (digest-size: %d)" digest_size) `Quick @@ fun () -> let module Hash = Digestif.Make_BLAKE2S (struct let digest_size = digest_size @@ -484,7 +484,7 @@ let blake2s_spe digest_size = Alcotest.(check str) "raw hash" raw_hash0 raw_hash1 let blake2b_spe digest_size = - Alcotest.test_case (Fmt.strf "BLAKE2B (digest-size: %d)" digest_size) `Quick + Alcotest.test_case (Fmt.str "BLAKE2B (digest-size: %d)" digest_size) `Quick @@ fun () -> let module Hash = Digestif.Make_BLAKE2B (struct let digest_size = digest_size diff --git a/test/test_runes.ml b/test/test_runes.ml index f1e0330..531344f 100755 --- a/test/test_runes.ml +++ b/test/test_runes.ml @@ -102,7 +102,7 @@ let libraries_exist args = | false -> check ps) in check paths | `Name library :: libraries -> - let lib = Fmt.strf "lib%s.a" library in + let lib = Fmt.str "lib%s.a" library in let rec check = function | [] -> R.error_msgf "Library lib%s.a does not exist." library | p0 :: ps -> ( @@ -127,7 +127,7 @@ let exists lib = let query target lib = let open Bos in - let format = Fmt.strf "-L%%d %%(%s_linkopts)" target in + let format = Fmt.str "-L%%d %%(%s_linkopts)" target in let command = Cmd.(v "ocamlfind" % "query" % "-format" % format % lib) in OS.Cmd.run_out command |> OS.Cmd.out_lines