add test/b32.ml; no need to re-pad in B32.decode

This commit is contained in:
swrup 2026-02-07 20:29:35 +01:00
parent c9842f5cc1
commit e2737ce527
4 changed files with 24 additions and 28 deletions

15
test/b32.ml Normal file
View file

@ -0,0 +1,15 @@
let () =
let id s = s |> B32.encode |> B32.decode |> Result.get_ok in
let f s =
let s' = id s in
match s' = s with
| false ->
Fmt.failwith "b32 round trip failure: @\nin :`%S`@\nout:`%S`" s' s
| true -> ()
in
let s = String.init 0xff Char.chr in
let s_l = List.init 0x0f (fun i -> String.init i Char.chr) in
f s;
List.iter f s_l;
()