X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=tests%2Fautomated%2Flisp-tests.el;h=5570fc8dd8f9a11f7e888974e15ec2bb6c62ddf1;hb=fd17e50cb86d263fe8aaffffb931726c697731dd;hp=13a08e9958b54ce31c91c8a9362b11a742b47752;hpb=a17da6cfe6279dbd4ad4a1ba618f862edb2da6fc;p=sxemacs diff --git a/tests/automated/lisp-tests.el b/tests/automated/lisp-tests.el index 13a08e9..5570fc8 100644 --- a/tests/automated/lisp-tests.el +++ b/tests/automated/lisp-tests.el @@ -61,6 +61,9 @@ (test-setq 42 (setq-default test-setq-bar 99 test-setq-var 42)) ) +;; Following test dies on recent libc's with MALLOC_PERTURB_=69 +(Check-Error wrong-type-argument (length (current-buffer))) + (let ((my-vector [1 2 3 4]) (my-bit-vector (bit-vector 1 0 1 0)) (my-string "1234") @@ -1103,3 +1106,31 @@ ;; Check all-completions ignore element start with space. (Assert (not (all-completions "" '((" hidden" . "object"))))) (Assert (all-completions " " '((" hidden" . "object")))) + + +;; Check filename/path manipulations +(let ((cases '(("/usr/lib" "/usr/" "lib" "/usr" "lib" "/usr/lib") + ("/usr/lib/" "/usr/lib/" "" "/usr" "lib" "/usr/lib") + ("/usr/" "/usr/" "" "/" "usr" "/usr") + ("/usr" "/" "usr" "/" "usr" "/usr") + ("usr" nil "usr" "." "usr" "./usr") + ("/" "/" "" "/" "/" "/") + ("." nil "." "." "." "./.") + ("./" "./" "" "." "." "./.") + (".." nil ".." "." ".." "./..")))) + (mapcar #'(lambda (case) + (let* ((path (car case)) + (directory (file-name-directory path)) + (nondirectory (file-name-nondirectory path)) + (dirname (file-dirname path)) + (basename (file-basename path))) + (Assert (equal directory (nth 1 case))) + (Assert (equal nondirectory (nth 2 case))) + (Assert (equal dirname (nth 3 case))) + (Assert (equal basename (nth 4 case))) + (Assert (equal path (concat directory nondirectory))) + (Assert (equal (file-name-join directory nondirectory) + (file-name-join dirname basename))) + (Assert (equal (file-name-join directory nondirectory) (nth 5 case))) + (Assert (equal (file-name-join dirname basename) (nth 5 case))))) + cases))