Commit 8bcd1b54 authored by Jan Idzikowski's avatar Jan Idzikowski

Further error in rfc2045-q-encode-string-to-stream fixed

 - add 2 new tests for correct dot masking
parent 4bb69f69
Version 20170922.1
2017.09.22
Further error in rfc2045-q-encode-string-to-stream fixed
add 2 new tests for correct dot masking
Change cl-smtp.asd, cl-smtp.lisp, tests.lisp CHANGELOG
Version 20170920.1
2017.09.20
Fix error in rfc2045-q-encode-string-to-stream
......
......@@ -21,7 +21,7 @@
:licence "LLGPL"
:author "Jan Idzikowski <jidzikowski@common-lisp.net>"
:maintainer "Jan Idzikowski <jidzikowski@common-lisp.net>"
:version "20170920.1"
:version "20170922.1"
:perform (load-op :after (op webpage)
(pushnew :cl-smtp cl:*features*))
:depends-on (:usocket
......
......@@ -120,12 +120,12 @@
(write-blank-line stream)
(setf last-line-break n))
(cond
((and (char= c #\.) (or (= n 0) (= (1- n) last-line-break)
((and (char= c #\.) (or (= n 0) (= n last-line-break)
(= last-line-break columns)))
(write-char #\. stream)
(write-char #\. stream))
((char= c #\NewLine)
(setf last-line-break n)
(setf last-line-break (1+ n))
(write-blank-line stream))
((or (char= c #\Space)
(char= c #\Tab))
......
......@@ -69,6 +69,22 @@ n !"
(assert qstr)
(assert (string-equal qstr (format nil "check of masked dot at last column 12345678901234567890123456789=~C~C..~C~C~C~CLAST LINE" #\Return #\Newline #\Return #\Newline #\Return #\Newline)))))
(define-cl-smtp-test "rfc2045-q-encode-string-to-stream-7" ()
(let* ((str (format nil "Example using non-ASCII characters:~A - 74% : Erreur de protocole : la passerelle ne répond pas à la requête.~AYou won’t receive this!" #\Newline #\Newline))
(qstr (with-output-to-string (s)
(rfc2045-q-encode-string-to-stream
str s :external-format :utf-8 :columns 74))))
(assert qstr)
(assert (string-equal qstr (format nil "Example using non-ASCII characters:~C~C - 74% : Erreur de protocole : la passerelle ne r=C3=A9pond pas =C3=A0 la requ=C3=AAte=~C~C..~C~CYou won=E2=80=99t receive this!" #\Return #\Newline #\Return #\Newline #\Return #\Newline)))))
(define-cl-smtp-test "rfc2045-q-encode-string-to-stream-8" ()
(let* ((str "12345678901234567890123456789012345678901234567890123456789012345678901234.")
(qstr (with-output-to-string (s)
(rfc2045-q-encode-string-to-stream
str s :external-format :utf-8 :columns 74))))
(assert qstr)
(assert (string-equal qstr (format nil"12345678901234567890123456789012345678901234567890123456789012345678901234=~C~C.." #\Return #\Newline)))))
(define-cl-smtp-test "string-has-non-ascii-1" ()
(assert (string-has-non-ascii "test Ü ende")))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment