/[gcl]/gcl/ansi-tests/rename-file.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/rename-file.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pfdietz, Mon Jan 26 02:58:00 2004 UTC revision 1.6 by pfdietz, Sun Sep 19 20:56:33 2004 UTC
# Line 131  Line 131 
131             ))))             ))))
132    t nil t (t t t nil nil) t nil t t)    t nil t (t t t nil nil) t nil t t)
133    
134  ;;;  ;;; Specialized string tests
135    
136    (deftest rename-file.6
137      (do-special-strings
138       (s "file-to-be-renamed.txt" nil)
139       (let ((pn1 s)
140             (pn2 "file-that-was-renamed.txt"))
141         (delete-all-versions pn1)
142         (delete-all-versions pn2)
143         (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
144         (let ((results (multiple-value-list (rename-file pn1 pn2))))
145           (destructuring-bind (defaulted-new-name old-truename new-truename)
146               results
147             (assert
148              (equal
149               (list
150                (=t (length results) 3)
151                (probe-file pn1)
152                (notnot (probe-file pn2))
153                (list (notnot (pathnamep defaulted-new-name))
154                      (notnot (pathnamep old-truename))
155                      (notnot (pathnamep new-truename))
156                      (typep old-truename 'logical-pathname)
157                      (typep new-truename 'logical-pathname))
158                (notnot (probe-file defaulted-new-name))
159                (probe-file old-truename)
160                (notnot (probe-file new-truename)))
161               '(t nil t (t t t nil nil) t nil t)))))))
162      nil)
163    
164    (deftest rename-file.7
165      (do-special-strings
166       (s "file-that-was-renamed.txt" nil)
167       (let ((pn1 "file-to-be-renamed.txt")
168             (pn2 s))
169         (delete-all-versions pn1)
170         (delete-all-versions pn2)
171         (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
172         (let ((results (multiple-value-list (rename-file pn1 pn2))))
173           (destructuring-bind (defaulted-new-name old-truename new-truename)
174               results
175             (assert
176              (equal
177               (list
178                (=t (length results) 3)
179                (probe-file pn1)
180                (notnot (probe-file pn2))
181                (list (notnot (pathnamep defaulted-new-name))
182                      (notnot (pathnamep old-truename))
183                      (notnot (pathnamep new-truename))
184                      (typep old-truename 'logical-pathname)
185                      (typep new-truename 'logical-pathname))
186                (notnot (probe-file defaulted-new-name))
187                (probe-file old-truename)
188                (notnot (probe-file new-truename)))
189               '(t nil t (t t t nil nil) t nil t)))))))
190      nil)
191    
192    ;;; Error tests
193    
194  (deftest rename-file.error.1  (deftest rename-file.error.1
195    (signals-error (rename-file) program-error)    (signals-error (rename-file) program-error)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26