translate-logical-pathname.lsp 1.33 KB
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Mon Dec 29 14:45:50 2003
;;;; Contains: Tests for TRANSLATE-LOGICAL-PATHNAME

6

7 8 9 10 11 12

;; On physical pathnames, t-l-p returns the pathname itself

;;; Every physical pathname is converted to itself
(deftest translate-logical-pathname.1
  (loop for p in *pathnames*
sds's avatar
sds committed
13 14 15
        unless (or (typep p 'logical-pathname)
                   (eq p (translate-logical-pathname p)))
        collect p)
16 17 18 19 20
  nil)

;;; &key arguments are allowed
(deftest translate-logical-pathname.2
  (loop for p in *pathnames*
sds's avatar
sds committed
21 22 23 24
        unless (or (typep p 'logical-pathname)
                   (eq p (translate-logical-pathname
                          p :allow-other-keys t)))
        collect p)
25 26 27 28
  nil)

(deftest translate-logical-pathname.3
  (loop for p in *pathnames*
sds's avatar
sds committed
29 30 31 32
        unless (or (typep p 'logical-pathname)
                   (eq p (translate-logical-pathname
                          p :allow-other-keys nil)))
        collect p)
33 34 35 36
  nil)

(deftest translate-logical-pathname.4
  (loop for p in *pathnames*
sds's avatar
sds committed
37 38 39 40
        unless (or (typep p 'logical-pathname)
                   (eq p (translate-logical-pathname
                          p :foo 1 :allow-other-keys t :bar 2)))
        collect p)
41 42 43 44 45 46
  nil)


;;; errors

(deftest translate-logical-pathname.error.1
47 48
  (signals-error (translate-logical-pathname) program-error)
  t)