diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/base64.scm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/base64.scm b/tests/base64.scm index dba4f3b..c6ebe8f 100644 --- a/tests/base64.scm +++ b/tests/base64.scm @@ -21,12 +21,28 @@ (with-tests "base64" (test-group "base64-decode" - (test-equal "encoded text no padding" + (test-equal "empty string" + "" + (utf8->string (base64-decode ""))) + (test-equal "no padding" "hello!" (utf8->string (base64-decode "aGVsbG8h"))) - (test-equal "encoded text with one byte of padding" + (test-equal "one byte of padding" "hello" (utf8->string (base64-decode "aGVsbG8="))) - (test-equal "encoded text with two bytes of padding" + (test-equal "two bytes of padding" "what's up?" - (utf8->string (base64-decode "d2hhdCdzIHVwPw=="))))) + (utf8->string (base64-decode "d2hhdCdzIHVwPw==")))) + (test-group "base64-encode" + (test-equal "empty string" + "" + (base64-encode (string->utf8 ""))) + (test-equal "no padding" + "aGVsbG8h" + (base64-encode (string->utf8 "hello!"))) + (test-equal "one byte of padding" + "aGVsbG8=" + (base64-encode (string->utf8 "hello"))) + (test-equal "two bytes of padding" + "d2hhdCdzIHVwPw==" + (base64-encode (string->utf8 "what's up?"))))) |