2
;;;; Author: Paul Dietz
3
;;;; Created: Tue Jan 13 18:42:29 2004
4
;;;; Contains: Tests for DELETE-FILE
9
(let ((pn "scratchfile.txt"))
10
(unless (probe-file pn)
11
(with-open-file (s pn :direction :output)
12
(format s "Contents~%")))
14
(notnot (probe-file pn))
15
(multiple-value-list (delete-file pn))
19
(deftest delete-file.2
20
(let ((pn #p"scratchfile.txt"))
21
(unless (probe-file pn)
22
(with-open-file (s pn :direction :output)
23
(format s "Contents~%")))
25
(notnot (probe-file pn))
26
(multiple-value-list (delete-file pn))
30
(deftest delete-file.3
31
(let ((pn "CLTEST:scratchfile.txt"))
32
(unless (probe-file pn)
33
(with-open-file (s pn :direction :output)
34
(format s "Contents~%")))
36
(notnot (probe-file pn))
37
(multiple-value-list (delete-file pn))
41
(deftest delete-file.4
42
(let ((pn "CLTEST:scratchfile.txt"))
43
(unless (probe-file pn)
44
(with-open-file (s pn :direction :output)
45
(format s "Contents~%")))
46
(let ((s (open pn :direction :input)))
49
(notnot (probe-file pn))
50
(multiple-value-list (delete-file s))
56
(deftest delete-file.error.1
57
(signals-error (delete-file) program-error)
60
(deftest delete-file.error.2
61
(let ((pn "scratch.txt"))
62
(unless (probe-file pn)
63
(with-open-file (s pn :direction :output)
64
(format s "Contents~%")))
66
(notnot (probe-file pn))
67
(signals-error (delete-file "scratch.txt" nil) program-error)
68
(notnot (probe-file pn))
74
(deftest delete-file.error.3
75
(let ((pn "nonexistent.txt"))
76
(when (probe-file pn) (delete-file pn))
77
(signals-error (delete-file "nonexistent.txt") file-error))