From fb0842424227427c1337dd6abff2acbf3cf9d397 Mon Sep 17 00:00:00 2001 From: kaoru Date: Sat, 1 Aug 2009 05:00:44 +0000 Subject: [PATCH] (test-utf7-decode-string-alpha): New testcase. (test-utf7-encode-string-alpha): Ditto. (test-utf7-decode-string-smiling-face): Ditto. (test-utf7-encode-string-smiling-face): Ditto. --- tests/ChangeLog | 5 ++++- tests/test-utf7.el | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 9f1cf8b..ade64ef 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -10,7 +10,10 @@ `test-utf7-decode-string'. Use `make-char'. (test-utf7-encode-string-nihongo): Rename from `test-utf7-encode-string'. Use `make-char'. - + (test-utf7-decode-string-alpha): New testcase. + (test-utf7-encode-string-alpha): Ditto. + (test-utf7-decode-string-smiling-face): Ditto. + (test-utf7-encode-string-smiling-face): Ditto. 2008-02-19 TAKAHASHI Kaoru diff --git a/tests/test-utf7.el b/tests/test-utf7.el index af56113..6d93943 100644 --- a/tests/test-utf7.el +++ b/tests/test-utf7.el @@ -20,6 +20,25 @@ (make-char 'japanese-jisx0208 75 92) (make-char 'japanese-jisx0208 56 108)))))) +(luna-define-method test-utf7-encode-string-smiling-face ((case test-utf7)) + (lunit-assert + (string= + "Hi Mom -+Jjo--!" + (utf7-encode-string + (concat "Hi Mom -" + (string (make-char 'mule-unicode-2500-33ff 35 58)) + "-!"))))) + +(luna-define-method test-utf7-encode-string-alpha ((case test-utf7)) + (lunit-assert + (string= + "A+ImIDkQ-." + (utf7-encode-string + (concat "A" + (string (make-char 'mule-unicode-0100-24ff 121 34) + (make-char 'mule-unicode-0100-24ff 38 113)) + "."))))) + (luna-define-method test-utf7-encode-string-plus ((case test-utf7)) (lunit-assert (string= "+-" (utf7-encode-string "+")))) @@ -43,6 +62,31 @@ (make-char 'japanese-jisx0208 56 108)) (utf7-decode-string "+ZeVnLIqe-")))) +(luna-define-method test-utf7-decode-string-smiling-face ((case test-utf7)) + (lunit-assert + (string= + (concat "Hi Mom -" + (string (make-char 'mule-unicode-2500-33ff 35 58)) + "-!") + (utf7-decode-string "Hi Mom -+Jjo--!")))) + +(luna-define-method test-utf7-decode-string-alpha ((case test-utf7)) + (lunit-assert + (string= + (concat "A" + (string (make-char 'mule-unicode-0100-24ff 121 34) + (make-char 'mule-unicode-0100-24ff 38 113)) + ".") + (utf7-decode-string "A+ImIDkQ."))) ; omit `-' + ;; + (lunit-assert + (string= + (concat "A" + (string (make-char 'mule-unicode-0100-24ff 121 34) + (make-char 'mule-unicode-0100-24ff 38 113)) + ".") + (utf7-decode-string "A+ImIDkQ-.")))) + (luna-define-method test-utf7-decode-string-plus ((case test-utf7)) (lunit-assert (string= "+" (utf7-decode-string "+-"))) -- 1.7.10.4