diff --git a/src/core/CCChar.ml b/src/core/CCChar.ml index 57556956..04b38d89 100644 --- a/src/core/CCChar.ml +++ b/src/core/CCChar.ml @@ -16,6 +16,11 @@ let of_int_exn = Char.chr let of_int c = try Some (of_int_exn c) with _ -> None let to_int = Char.code +(*$= + (Some 'a') (of_int (to_int 'a')) + None (of_int 257) +*) + let to_string c = String.make 1 c (*$Q to_string diff --git a/src/core/CCInt.ml b/src/core/CCInt.ml index 6cb7ba3e..1483dc87 100644 --- a/src/core/CCInt.ml +++ b/src/core/CCInt.ml @@ -204,6 +204,11 @@ let of_string s = try Some (int_of_string s) with _ -> None +(*$= + None (of_string "moo") + (Some 42) (of_string "42") +*) + type output = char -> unit (* abstract printer *)