b32: add test + rm padding
This commit is contained in:
parent
c9842f5cc1
commit
c3b36461cf
4 changed files with 24 additions and 28 deletions
15
test/b32.ml
Normal file
15
test/b32.ml
Normal 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;
|
||||
|
||||
()
|
||||
Loading…
Add table
Add a link
Reference in a new issue