add test for String.to_hex

This commit is contained in:
Simon Cruanes 2022-06-09 21:11:47 -04:00
parent 911e9faff7
commit 977e0c9577
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -1173,9 +1173,11 @@ let of_hex s = try Some (of_hex_exn s) with Invalid_argument _ -> None
*)
(*$Q
Q.(string) (fun s -> \
of_hex_exn (to_hex s) = s)
*)
Q.(string) (fun s -> \
of_hex_exn (to_hex s) = s)
Q.(string) (fun s -> \
String.for_all (function 'A'..'F'|'a'..'f'|'0'..'9' -> true | _ -> false) @@ to_hex s)
*)
let pp_buf buf s =
Buffer.add_char buf '"';