;;;; ;;;; test-base64.stk -- Testing base64 functions ;;;; ;;;; Copyright © 2006-2007 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program; if not, write to the Free Software ;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ;;;; USA. ;;;; ;;;; Author: Erick Gallesio [eg@essi.fr] ;;;; Creation date: 26-Nov-2006 10:47 (eg) ;;;; Last file update: 13-May-2007 23:52 (eg) ;;;; (require "test") (test-section "Base64 functions") ;;------------------------------------------------------------------ (test-subsection "Encoding") (test "encoding length 0" "" (base64-encode-string "")) (test "encoding length 1" "YQ==" (base64-encode-string "a")) (test "encoding length 2" "YWI=" (base64-encode-string "ab")) (test "encoding length 3" "YWJj" (base64-encode-string "abc")) (test "encoding length 4" "YWJjZA==" (base64-encode-string "abcd")) (test "encoding length 62" "MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFy\nc3R1dnd4eXo=" (base64-encode-string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) ;;------------------------------------------------------------------ (test-subsection "Decoding") (test "decoding length 0" "" (base64-decode-string "")) (test "decoding length 1" "a" (base64-decode-string "YQ==")) (test "decoding length 2" "ab" (base64-decode-string "YWI=")) (test "decoding length 3" "abc" (base64-decode-string "YWJj")) (test "decoding length 4" "abcd" (base64-decode-string "YWJjZA==")) (test "decoding length 26" "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" (base64-decode-string "MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=")) ;;------------------------------------------------------------------ (test-section-end)