2
;;;; Author: Paul Dietz
3
;;;; Created: Wed Dec 31 16:54:55 2003
4
;;;; Contains: Tests of WILD-PATHNAME-P
8
(deftest wild-pathname-p.1
9
(wild-pathname-p (make-pathname))
12
(deftest wild-pathname-p.2
13
(loop for key in '(:host :device :directory :name :type :version nil)
14
when (wild-pathname-p (make-pathname) key)
18
(deftest wild-pathname-p.3
19
(let ((p (make-pathname :directory :wild)))
20
(notnot-mv (wild-pathname-p p)))
23
(deftest wild-pathname-p.4
24
(let ((p (make-pathname :directory :wild)))
25
(notnot-mv (wild-pathname-p p nil)))
28
(deftest wild-pathname-p.5
29
(let ((p (make-pathname :directory :wild)))
30
(notnot-mv (wild-pathname-p p :directory)))
33
(deftest wild-pathname-p.6
34
(let ((p (make-pathname :directory :wild)))
35
(loop for key in '(:host :device :name :type :version)
36
when (wild-pathname-p p key)
41
(deftest wild-pathname-p.7
42
(let ((p (make-pathname :directory '(:absolute :wild))))
43
(notnot-mv (wild-pathname-p p)))
46
(deftest wild-pathname-p.8
47
(let ((p (make-pathname :directory '(:absolute :wild))))
48
(notnot-mv (wild-pathname-p p nil)))
51
(deftest wild-pathname-p.9
52
(let ((p (make-pathname :directory '(:absolute :wild))))
53
(notnot-mv (wild-pathname-p p :directory)))
56
(deftest wild-pathname-p.10
57
(let ((p (make-pathname :directory '(:absolute :wild))))
58
(loop for key in '(:host :device :name :type :version)
59
when (wild-pathname-p p key)
64
(deftest wild-pathname-p.11
65
(let ((p (make-pathname :directory '(:relative :wild))))
66
(notnot-mv (wild-pathname-p p)))
69
(deftest wild-pathname-p.12
70
(let ((p (make-pathname :directory '(:relative :wild))))
71
(notnot-mv (wild-pathname-p p nil)))
74
(deftest wild-pathname-p.13
75
(let ((p (make-pathname :directory '(:relative :wild))))
76
(notnot-mv (wild-pathname-p p :directory)))
79
(deftest wild-pathname-p.14
80
(let ((p (make-pathname :directory '(:relative :wild))))
81
(loop for key in '(:host :device :name :type :version)
82
when (wild-pathname-p p key)
88
(deftest wild-pathname-p.15
89
(let ((p (make-pathname :name :wild)))
90
(notnot-mv (wild-pathname-p p)))
93
(deftest wild-pathname-p.16
94
(let ((p (make-pathname :name :wild)))
95
(notnot-mv (wild-pathname-p p nil)))
98
(deftest wild-pathname-p.17
99
(let ((p (make-pathname :name :wild)))
100
(notnot-mv (wild-pathname-p p :name)))
103
(deftest wild-pathname-p.18
104
(let ((p (make-pathname :name :wild)))
105
(loop for key in '(:host :device :directory :type :version)
106
when (wild-pathname-p p key)
112
(deftest wild-pathname-p.19
113
(let ((p (make-pathname :type :wild)))
114
(notnot-mv (wild-pathname-p p)))
117
(deftest wild-pathname-p.20
118
(let ((p (make-pathname :type :wild)))
119
(notnot-mv (wild-pathname-p p nil)))
122
(deftest wild-pathname-p.21
123
(let ((p (make-pathname :type :wild)))
124
(notnot-mv (wild-pathname-p p :type)))
127
(deftest wild-pathname-p.22
128
(let ((p (make-pathname :type :wild)))
129
(loop for key in '(:host :device :directory :name :version)
130
when (wild-pathname-p p key)
136
(deftest wild-pathname-p.23
137
(let ((p (make-pathname :version :wild)))
138
(notnot-mv (wild-pathname-p p)))
141
(deftest wild-pathname-p.24
142
(let ((p (make-pathname :version :wild)))
143
(notnot-mv (wild-pathname-p p nil)))
146
(deftest wild-pathname-p.25
147
(let ((p (make-pathname :version :wild)))
148
(notnot-mv (wild-pathname-p p :version)))
151
(deftest wild-pathname-p.26
152
(let ((p (make-pathname :version :wild)))
153
(loop for key in '(:host :device :directory :name :type)
154
when (wild-pathname-p p key)
160
(deftest wild-pathname-p.27
161
(loop for p in (append *pathnames* *logical-pathnames*)
162
unless (if (wild-pathname-p p) (wild-pathname-p p nil)
163
(not (wild-pathname-p p nil)))
167
(deftest wild-pathname-p.28
168
(loop for p in (append *pathnames* *logical-pathnames*)
169
when (and (loop for key in '(:host :device :directory
170
:name :type :version)
171
thereis (wild-pathname-p p key))
172
(not (wild-pathname-p p)))
176
;;; On streams associated with files
178
(deftest wild-pathname-p.29
179
(with-open-file (s "foo.lsp"
182
:if-does-not-exist :create)
186
(deftest wild-pathname-p.30
187
(let ((s (open "foo.lsp"
190
:if-does-not-exist :create)))
195
;;; logical pathname designators
197
(deftest wild-pathname-p.31
198
(wild-pathname-p "CLTEST:FOO.LISP")
203
(deftest wild-pathname-p.error.1
204
(signals-error (wild-pathname-p) program-error)
207
(deftest wild-pathname-p.error.2
208
(signals-error (wild-pathname-p *default-pathname-defaults* nil nil)
212
(deftest wild-pathname-p.error.3
213
(loop for x in *mini-universe*
214
unless (or (could-be-pathname-designator x)
215
(eval `(signals-error (wild-pathname-p ',x)