From 977e0c9577818ffcee164a0a19bc3817bb1b133b Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 9 Jun 2022 21:11:47 -0400 Subject: [PATCH] add test for String.to_hex --- src/core/CCString.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/CCString.ml b/src/core/CCString.ml index 6c5ae1c5..3b837ab0 100644 --- a/src/core/CCString.ml +++ b/src/core/CCString.ml @@ -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 '"';