Unittest mime base64 decoder encoder

This commit is contained in:
anon 2024-04-19 12:47:16 +02:00
parent ca4adf991f
commit aa0f47caa1
1 changed files with 12 additions and 0 deletions

12
email.d
View File

@ -1179,6 +1179,18 @@ immutable(ubyte[]) decodeBase64Mime(string encodedPart) {
.array;
}
unittest {
// Mime base64 roundtrip
import std.algorithm.comparison;
string source = chain(
repeat('n', 1200), //long line
"\r\n",
"äöü\r\n",
"ඞ\rn",
).byChar.array;
assert( source.representation.encodeBase64Mime.decodeBase64Mime.equal(source));
}
/+
void main() {
import std.file;