source: trunk/source/tests/ansi-tests/directory.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.6 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Jan  1 12:00:18 2004
4;;;; Contains: Tests of DIRECTORY
5
6(in-package :cl-test)
7
8(deftest directory.1
9  (directory "nonexistent")
10  nil)
11
12(deftest directory.2
13  (directory #p"nonexistent")
14  nil)
15
16(deftest directory.3
17  (directory "nonexistent" :allow-other-keys nil)
18  nil)
19
20(deftest directory.4
21  (directory "nonexistent" :allow-other-keys t :foo 'bar)
22  nil)
23
24(deftest directory.5
25  (directory "nonexistent" :foo 0 :allow-other-keys t)
26  nil)
27
28(deftest directory.6
29  (let* ((pattern-pathname (make-pathname :name :wild :type :wild
30                                          :defaults *default-pathname-defaults*))
31         (pathnames (directory pattern-pathname)))
32    (values
33     (remove-if #'pathnamep pathnames)
34     (loop for pn in pathnames
35           unless (equal pn (truename pn))
36           collect pn)
37;;     (loop for pn in pathnames
38;;         unless (pathname-match-p pn pattern-pathname)
39;;         collect pn))
40     ))
41  nil nil ;; nil
42  )
43
44(deftest directory.7
45  (let* ((pattern-pathname (make-pathname :name :wild :type :wild
46                                          :defaults *default-pathname-defaults*))
47         (pathnames (directory pattern-pathname)))
48    (loop for pn in pathnames
49          unless (equal pn (probe-file pn))
50          collect pn))
51  nil)
52
53(deftest directory.8
54  (let* ((pathname-pattern "CLTEST:*.*")
55         (len (length (directory pathname-pattern))))
56    (if (< len 500) len nil))
57  nil)
58
59;;; Specialized string tests
60
61(deftest directory.9
62  (do-special-strings
63   (s "nonexistent" nil)
64   (assert (null (directory s))))
65  nil)
66
67;;; Error tests
68
69(deftest directory.error.1
70  (signals-error (directory) program-error)
71  t)
Note: See TracBrowser for help on using the repository browser.