~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/wild-pathname-p.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;-*- Mode:     Lisp -*-
 
2
;;;; Author:   Paul Dietz
 
3
;;;; Created:  Wed Dec 31 16:54:55 2003
 
4
;;;; Contains: Tests of WILD-PATHNAME-P
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(deftest wild-pathname-p.1
 
9
  (wild-pathname-p (make-pathname))
 
10
  nil)
 
11
 
 
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)
 
15
        collect key)
 
16
  nil)
 
17
 
 
18
(deftest wild-pathname-p.3
 
19
  (let ((p (make-pathname :directory :wild)))
 
20
    (notnot-mv (wild-pathname-p p)))
 
21
  t)
 
22
 
 
23
(deftest wild-pathname-p.4
 
24
  (let ((p (make-pathname :directory :wild)))
 
25
    (notnot-mv (wild-pathname-p p nil)))
 
26
  t)
 
27
 
 
28
(deftest wild-pathname-p.5
 
29
  (let ((p (make-pathname :directory :wild)))
 
30
    (notnot-mv (wild-pathname-p p :directory)))
 
31
  t)
 
32
 
 
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)
 
37
        collect key))
 
38
  nil)
 
39
 
 
40
 
 
41
(deftest wild-pathname-p.7
 
42
  (let ((p (make-pathname :directory '(:absolute :wild))))
 
43
    (notnot-mv (wild-pathname-p p)))
 
44
  t)
 
45
 
 
46
(deftest wild-pathname-p.8
 
47
  (let ((p (make-pathname :directory '(:absolute :wild))))
 
48
    (notnot-mv (wild-pathname-p p nil)))
 
49
  t)
 
50
 
 
51
(deftest wild-pathname-p.9
 
52
  (let ((p (make-pathname :directory '(:absolute :wild))))
 
53
    (notnot-mv (wild-pathname-p p :directory)))
 
54
  t)
 
55
 
 
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)
 
60
        collect key))
 
61
  nil)
 
62
 
 
63
 
 
64
(deftest wild-pathname-p.11
 
65
  (let ((p (make-pathname :directory '(:relative :wild))))
 
66
    (notnot-mv (wild-pathname-p p)))
 
67
  t)
 
68
 
 
69
(deftest wild-pathname-p.12
 
70
  (let ((p (make-pathname :directory '(:relative :wild))))
 
71
    (notnot-mv (wild-pathname-p p nil)))
 
72
  t)
 
73
 
 
74
(deftest wild-pathname-p.13
 
75
  (let ((p (make-pathname :directory '(:relative :wild))))
 
76
    (notnot-mv (wild-pathname-p p :directory)))
 
77
  t)
 
78
 
 
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)
 
83
        collect key))
 
84
  nil)
 
85
 
 
86
;;;
 
87
 
 
88
(deftest wild-pathname-p.15
 
89
  (let ((p (make-pathname :name :wild)))
 
90
    (notnot-mv (wild-pathname-p p)))
 
91
  t)
 
92
 
 
93
(deftest wild-pathname-p.16
 
94
  (let ((p (make-pathname :name :wild)))
 
95
    (notnot-mv (wild-pathname-p p nil)))
 
96
  t)
 
97
 
 
98
(deftest wild-pathname-p.17
 
99
  (let ((p (make-pathname :name :wild)))
 
100
    (notnot-mv (wild-pathname-p p :name)))
 
101
  t)
 
102
 
 
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)
 
107
        collect key))
 
108
  nil)
 
109
 
 
110
;;;    
 
111
  
 
112
(deftest wild-pathname-p.19
 
113
  (let ((p (make-pathname :type :wild)))
 
114
    (notnot-mv (wild-pathname-p p)))
 
115
  t)
 
116
 
 
117
(deftest wild-pathname-p.20
 
118
  (let ((p (make-pathname :type :wild)))
 
119
    (notnot-mv (wild-pathname-p p nil)))
 
120
  t)
 
121
 
 
122
(deftest wild-pathname-p.21
 
123
  (let ((p (make-pathname :type :wild)))
 
124
    (notnot-mv (wild-pathname-p p :type)))
 
125
  t)
 
126
 
 
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)
 
131
        collect key))
 
132
  nil)
 
133
 
 
134
;;;
 
135
 
 
136
 (deftest wild-pathname-p.23
 
137
  (let ((p (make-pathname :version :wild)))
 
138
    (notnot-mv (wild-pathname-p p)))
 
139
  t)
 
140
 
 
141
(deftest wild-pathname-p.24
 
142
  (let ((p (make-pathname :version :wild)))
 
143
    (notnot-mv (wild-pathname-p p nil)))
 
144
  t)
 
145
 
 
146
(deftest wild-pathname-p.25
 
147
  (let ((p (make-pathname :version :wild)))
 
148
    (notnot-mv (wild-pathname-p p :version)))
 
149
  t)
 
150
 
 
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)
 
155
        collect key))
 
156
  nil)
 
157
 
 
158
;;;
 
159
 
 
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)))
 
164
        collect p)
 
165
  nil)
 
166
 
 
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)))
 
173
        collect p)
 
174
  nil)
 
175
 
 
176
;;; On streams associated with files
 
177
 
 
178
(deftest wild-pathname-p.29
 
179
  (with-open-file (s "foo.lsp"
 
180
                     :direction :output
 
181
                     :if-exists :append
 
182
                     :if-does-not-exist :create)
 
183
                  (wild-pathname-p s))
 
184
  nil)
 
185
 
 
186
(deftest wild-pathname-p.30
 
187
  (let ((s (open "foo.lsp"
 
188
                 :direction :output
 
189
                 :if-exists :append
 
190
                 :if-does-not-exist :create)))
 
191
    (close s)
 
192
    (wild-pathname-p s))
 
193
  nil)
 
194
 
 
195
;;; logical pathname designators
 
196
 
 
197
(deftest wild-pathname-p.31
 
198
  (wild-pathname-p "CLTEST:FOO.LISP")
 
199
  nil)
 
200
 
 
201
;;;
 
202
 
 
203
(deftest wild-pathname-p.error.1
 
204
  (signals-error (wild-pathname-p) program-error)
 
205
  t)
 
206
 
 
207
(deftest wild-pathname-p.error.2
 
208
  (signals-error (wild-pathname-p *default-pathname-defaults* nil nil)
 
209
                 program-error)
 
210
  t)
 
211
 
 
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)
 
216
                                         type-error)))
 
217
        collect x)
 
218
  nil)