mirror of https://github.com/adamdruppe/arsd.git
Unittest mime base64 decoder encoder
This commit is contained in:
parent
ca4adf991f
commit
aa0f47caa1
12
email.d
12
email.d
|
@ -1179,6 +1179,18 @@ immutable(ubyte[]) decodeBase64Mime(string encodedPart) {
|
||||||
.array;
|
.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() {
|
void main() {
|
||||||
import std.file;
|
import std.file;
|
||||||
|
|
Loading…
Reference in New Issue