From 9ae66b7d1a83474010bc3612c5b22c85526c85fd Mon Sep 17 00:00:00 2001 From: Frank Denis <124872+jedisct1@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:09:47 +0200 Subject: [PATCH] std.base64: add tests for decoderWithIgnore --- lib/std/base64.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/std/base64.zig b/lib/std/base64.zig index e9e3896c73ed52caacbccbe74bd010a2a01a4af5..9771436f45b4943669910077e2938a34eae1cd08 100644 --- a/lib/std/base64.zig +++ b/lib/std/base64.zig @@ -407,6 +407,20 @@ test "base64 url_safe_no_pad" { try comptime testAllApis(url_safe_no_pad, "comptime", "Y29tcHRpbWU"); } +test "base64 standard_no_pad" { + @setEvalBranchQuota(8000); + try testAllApis(standard_no_pad, "f", "Zg"); + try comptime testAllApis(standard_no_pad, "comptime", "Y29tcHRpbWU"); + try testError(standard_no_pad, "Zg==", error.InvalidCharacter); +} + +test "base64 url_safe" { + @setEvalBranchQuota(8000); + try testAllApis(url_safe, "f", "Zg=="); + try comptime testAllApis(url_safe, "comptime", "Y29tcHRpbWU="); + try testError(url_safe, "Zg", error.InvalidPadding); +} + fn testBase64() !void { const codecs = standard; -- 2.54.0