Skip to content

Commit

Permalink
Merge pull request #121 from mirage/fix-fmt
Browse files Browse the repository at this point in the history
Fix deprecated function from `fmt` module into tests
  • Loading branch information
dinosaure authored Oct 11, 2021
2 parents 65a5c12 + 0773ae1 commit f2cf462
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions digestif.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/conv/test_conv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_runes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> (
Expand All @@ -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
Expand Down

0 comments on commit f2cf462

Please sign in to comment.