aboutsummaryrefslogtreecommitdiff
path: root/src/unit/base64.unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/base64.unit')
-rw-r--r--src/unit/base64.unit28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/unit/base64.unit b/src/unit/base64.unit
new file mode 100644
index 0000000..e4630c5
--- /dev/null
+++ b/src/unit/base64.unit
@@ -0,0 +1,28 @@
1// vim: syntax=cpp
2/*
3 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
4 *
5 * This file is part of the libbu++ library and is released under the
6 * terms of the license contained in the file LICENSE.
7 */
8
9#include "bu/strfilter.h"
10#include "bu/base64.h"
11
12suite MemBuf
13{
14 test decode01
15 {
16 unitTest( Bu::decodeStr<Bu::Base64>("RnVu") == "Fun" );
17 unitTest( Bu::decodeStr<Bu::Base64>("V2hhdA==") == "What" );
18 unitTest( Bu::decodeStr<Bu::Base64>("SGVsbG8=") == "Hello" );
19 }
20
21 test encode01
22 {
23 unitTest( Bu::decodeStr<Bu::Base64>("R n V u") == "Fun" );
24 unitTest( Bu::decodeStr<Bu::Base64>("V2\n\n\thh dA==") == "What" );
25 unitTest( Bu::decodeStr<Bu::Base64>("\n\n\t\t SGV\r\ns\tbG8\n=") == "Hello" );
26 }
27}
28