mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
base32: update base32 api
Update the base32 api to be consistent with the recent changes to the
base64 api introduced by commit 60101830 ("Updated base64 encoding
api").
This commit is contained in:
committed by
Christoffer Lerno
parent
b0c0fd7dc8
commit
8d03aafe72
@@ -98,3 +98,18 @@ fn void decode_nopadding()
|
||||
decode_tests(std_tests, base32::STD_ALPHABET, -1);
|
||||
decode_tests(hex_tests, base32::HEX_ALPHABET, -1);
|
||||
}
|
||||
|
||||
fn void! base32_api()
|
||||
{
|
||||
@pool()
|
||||
{
|
||||
foreach (t : std_tests)
|
||||
{
|
||||
String got = base32::encode_temp(t.dec)!;
|
||||
assert(got == t.enc, "got: %s, want: %s", got, t.enc);
|
||||
|
||||
char[] got_chars = base32::decode_temp(t.enc)!;
|
||||
assert(got_chars == t.dec, "got: %s, want: %s", got_chars, t.dec);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user