Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
reynir committed Nov 30, 2020
1 parent fa375d8 commit 69da8f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ let test_nocrypto () =
Alcotest.(check (option string)) (sprintf "decode %S" input) res' res)
nocrypto_tests

let test_reynir () =
let r = "Hello, World!" in
let a = Base64.(alphabet default_alphabet) in
let () = Array.iteri (fun i _ -> a.(i) <- int_of_char 'A') a in
Alcotest.(check string) "decode encode after mutating default_alphabet"
r Base64.(decode_exn (encode_string r))

exception Malformed

exception Wrong_padding
Expand Down Expand Up @@ -309,6 +316,7 @@ let test_codec =
("Cfcs test vectors", `Quick, test_cfcs);
("PHP test vectors", `Quick, test_php);
("Nocrypto test vectors", `Quick, test_nocrypto);
("Reynir test vectors", `Quick, test_reynir);
]

let () =
Expand Down

0 comments on commit 69da8f9

Please sign in to comment.