-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-tmpdir.lisp
More file actions
32 lines (29 loc) · 955 Bytes
/
test-tmpdir.lisp
File metadata and controls
32 lines (29 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(defpackage :tmpdir.tests
(:use :cl
:tmpdir
:fiveam)
(:export))
(in-package :tmpdir.tests)
(test dir-exists-p
(let (dir-copy)
(with-tmpdir (dir)
(setf dir-copy dir)
(is-true (path:-d dir)))
(is-false (path:-e dir-copy))))
(test deletes-inside-directory
(let (test-file)
(with-tmpdir (dir)
(setf test-file (path:catfile dir "test.txt"))
(with-open-file (f test-file :direction :output))
(is-true (path:-e test-file)))
(is-false (path:-e test-file))))
(test does-not-follow-symlinks
(with-tmpdir (outside :prefix "outside")
(let ((outfile (path:catfile outside "test.txt")))
(with-open-file (f outfile :direction :output))
(with-tmpdir (dir :prefix "dir")
(osicat:make-link (path:catfile dir "test.txt")
:target outfile
:hard nil))
(is-true (path:-e outside))
(is-true (path:-e outfile)))))