Skip to content

Commit 977e0c9

Browse files
committed
add test for String.to_hex
1 parent 911e9fa commit 977e0c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/CCString.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,9 +1173,11 @@ let of_hex s = try Some (of_hex_exn s) with Invalid_argument _ -> None
11731173
*)
11741174

11751175
(*$Q
1176-
Q.(string) (fun s -> \
1177-
of_hex_exn (to_hex s) = s)
1178-
*)
1176+
Q.(string) (fun s -> \
1177+
of_hex_exn (to_hex s) = s)
1178+
Q.(string) (fun s -> \
1179+
String.for_all (function 'A'..'F'|'a'..'f'|'0'..'9' -> true | _ -> false) @@ to_hex s)
1180+
*)
11791181

11801182
let pp_buf buf s =
11811183
Buffer.add_char buf '"';

0 commit comments

Comments
 (0)