From 69da8f9bee763590a37e1eaab7a4e5bbd9bf4201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 30 Nov 2020 22:56:15 +0100 Subject: [PATCH] Add failing test --- test/test.ml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.ml b/test/test.ml index 41a4b9a..81d92ef 100644 --- a/test/test.ml +++ b/test/test.ml @@ -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 @@ -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 () =