[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Wed Apr 11 11:39:03 UTC 2012


Update of /project/slime/cvsroot/slime
In directory tiger.common-lisp.net:/tmp/cvs-serv12236

Modified Files:
	slime.el 
Log Message:
* slime.el ([test] utf-8-source): Use the encoded byte sequence of
the Unicode string.


--- /project/slime/cvsroot/slime/slime.el	2012/04/10 17:52:57	1.1399
+++ /project/slime/cvsroot/slime/slime.el	2012/04/11 11:39:03	1.1400
@@ -8019,51 +8019,53 @@
         (slime-check "Compilation successfull" 
           (eq (slime-compilation-result.successp result) t))))))
 
-(when (and (featurep 'emacs)
-           (>= emacs-major-version 23))
-  (def-slime-test utf-8-source
-      (input output)
+(def-slime-test utf-8-source
+    (input output)
     "Source code containing utf-8 should work"
-    (list (list (format "(defun cl-user::foo () \"%c%c%c%c\")"
-                        #x304a #x306f #x3088 #x3046)
-                (format "%c%c%c%c"
-                        #x304a #x306f #x3088 #x3046)))
-    (slime-eval `(cl:eval (cl:read-from-string ,input)))
-    (slime-test-expect "Eval result correct"
-                       output (slime-eval '(cl-user::foo)))
-    (let ((cell (cons nil nil)))
-      (let ((hook (slime-curry (lambda (cell &rest _) (setcar cell t)) cell)))
+    (list (let*  ((bytes "\343\201\212\343\201\257\343\202\210\343\201\206")
+                  ;;(encode-coding-string (string #x304a #x306f #x3088 #x3046)
+                  ;;                      'utf-8)
+                  (string (decode-coding-string bytes 'utf-8-unix)))
+            (assert (equal bytes (encode-coding-string string 'utf-8-unix)))
+            (list (concat "(defun cl-user::foo () \"" string "\")")
+                  string)))
+  (slime-eval `(cl:eval (cl:read-from-string ,input)))
+  (slime-test-expect "Eval result correct"
+                     output (slime-eval '(cl-user::foo)))
+  (let ((cell (cons nil nil)))
+    (let ((hook (slime-curry (lambda (cell &rest _) (setcar cell t)) cell)))
+      (add-hook 'slime-compilation-finished-hook hook)
+      (unwind-protect 
+          (progn
+            (slime-compile-string input 0)
+            (slime-wait-condition "Compilation finished" 
+                                  (lambda () (car cell))
+                                  0.5)
+            (slime-test-expect "Compile-string result correct"
+                               output (slime-eval '(cl-user::foo))))
+        (remove-hook 'slime-compilation-finished-hook hook))
+      (let ((filename "/tmp/slime-tmp-file.lisp"))
+        (setcar cell nil)
         (add-hook 'slime-compilation-finished-hook hook)
-        (unwind-protect 
-             (progn
-               (slime-compile-string input 0)
-               (slime-wait-condition "Compilation finished" 
-                                     (lambda () (car cell))
-                                     0.5)
-               (slime-test-expect "Compile-string result correct"
-                                  output (slime-eval '(cl-user::foo))))
-          (remove-hook 'slime-compilation-finished-hook hook))
-        (let ((filename "/tmp/slime-tmp-file.lisp"))
-          (setcar cell nil)
-          (add-hook 'slime-compilation-finished-hook hook)
-          (unwind-protect
-               (with-temp-buffer
-                   (when (fboundp 'set-buffer-multibyte)
-                     (set-buffer-multibyte t))
-                 (setq buffer-file-coding-system 'utf-8-unix)
-                 (setq buffer-file-name filename)
-                 (insert ";; -*- coding: utf-8-unix -*- \n")
-                 (insert input)
-                 (write-region nil nil filename nil t)
-                 (let ((slime-load-failed-fasl 'always))
-                   (slime-compile-and-load-file)
-                   (slime-wait-condition "Compilation finished" 
-                                         (lambda () (car cell))
-                                         0.5))
-                 (slime-test-expect "Compile-file result correct"
-                                    output (slime-eval '(cl-user::foo))))
-            (remove-hook 'slime-compilation-finished-hook hook)
-            (ignore-errors (delete-file filename))))))))
+        (unwind-protect
+            (with-temp-buffer
+              (when (fboundp 'set-buffer-multibyte)
+                (set-buffer-multibyte t))
+              (setq buffer-file-coding-system 'utf-8-unix)
+              (setq buffer-file-name filename)
+              (insert ";; -*- coding: utf-8-unix -*- \n")
+              (insert input)
+              (let ((coding-system-for-write 'utf-8-unix))
+                (write-region nil nil filename nil t))
+              (let ((slime-load-failed-fasl 'always))
+                (slime-compile-and-load-file)
+                (slime-wait-condition "Compilation finished" 
+                                      (lambda () (car cell))
+                                      0.5))
+              (slime-test-expect "Compile-file result correct"
+                                 output (slime-eval '(cl-user::foo))))
+          (remove-hook 'slime-compilation-finished-hook hook)
+          (ignore-errors (delete-file filename)))))))
 
 (def-slime-test async-eval-debugging (depth)
   "Test recursive debugging of asynchronous evaluation requests."





More information about the slime-cvs mailing list