diff options
author | sterni <sternenseemann@systemli.org> | 2023-05-18T15·19+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-05-18T16·18+0000 |
commit | b388354c4d34f67ab92d98fbb90dc07e3cdc5430 (patch) | |
tree | f1c6d704e1007352d04f4863f68485e2e85daeca /third_party/lisp/mime4cl/test/endec.lisp | |
parent | 02684f3ac66c5a87443da799b08b1b3629d29b03 (diff) |
refactor(3p/lisp/mime4cl): port remaining base64 decoding to qbase64 r/6156
DECODE-BASE64-STREAM-TO-SEQUENCE is the only thing that requires anything fancy: We read into an adjustable array. Alternative could be using REDIRECT-STREAM and WITH-OUTPUT-TO-STRING, but that is likely slower (untested). Test cases are kept for now to confirm that qbase64 is conforming to our expectations, but can probably dropped in favor of a few more sample messages in the test suite. :START and :END are sadly no longer supported and need to be replaced by SUBSEQ. Change-Id: I5928aed7551b0dea32ee09518ea6f604b40c2863 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8586 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'third_party/lisp/mime4cl/test/endec.lisp')
-rw-r--r-- | third_party/lisp/mime4cl/test/endec.lisp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/lisp/mime4cl/test/endec.lisp b/third_party/lisp/mime4cl/test/endec.lisp index 4ff89d5eacb0..07e7abbf9e43 100644 --- a/third_party/lisp/mime4cl/test/endec.lisp +++ b/third_party/lisp/mime4cl/test/endec.lisp @@ -103,13 +103,12 @@ line") (deftest base64.3 (map 'string #'code-char - (decode-base64-string "U29tZSByYW5kb20gc3RyaW5nLg==")) + (qbase64:decode-string "U29tZSByYW5kb20gc3RyaW5nLg==")) "Some random string.") (deftest base64.4 (map 'string #'code-char - (decode-base64-string "some rubbish U29tZSByYW5kb20gc3RyaW5nLg== more rubbish" - :start 13 :end 41)) + (qbase64:decode-string "U29tZSByYW5kb20gc3RyaW5nLg==")) "Some random string.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -117,6 +116,7 @@ line") (deftest RFC2047.1 (parse-RFC2047-text "foo bar") ("foo bar")) +;; TODO(sterni): more RFC2047 test cases (defun perftest-encoder (encoder-class &optional (megs 100)) (declare (optimize (speed 3) (debug 0) (safety 0)) @@ -145,7 +145,6 @@ line") (let* ((meg (* 1024 1024)) (buffer (make-sequence '(vector (unsigned-byte 8)) meg)) (encoder-class (ecase decoder-class - (mime4cl:base64-decoder 'mime4cl:base64-encoder) (mime4cl:quoted-printable-decoder 'mime4cl:quoted-printable-encoder))) (encoder (make-instance encoder-class :output-function #'(lambda (c) |