source: trunk/source/tests/ansi-tests/directory-namestring.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.4 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Sep 12 06:21:42 2004
4;;;; Contains: Tests for DIRECTORY-NAMESTRING
5
6(in-package :cl-test)
7
8(deftest directory-namestring.1
9  (let* ((vals (multiple-value-list
10                (directory-namestring "directory-namestring.lsp")))
11         (s (first vals)))
12    (if (and (null (cdr vals))
13             (stringp s)
14             (equal (directory-namestring s) s))
15        :good
16      vals))
17  :good)
18
19(deftest directory-namestring.2
20  (do-special-strings
21   (s "directory-namestring.lsp" nil)
22   (let ((ns (directory-namestring s)))
23     (assert (stringp ns))
24     (assert (string= (directory-namestring ns) ns))))
25  nil)
26
27;;; Lispworks makes another assumption about filename normalization
28;;; when using file streams as pathname designators, so this test
29;;; doesn't work there.
30;;; (This is another example of the difficulty of testing a feature
31;;;  in which so much is left up to the implementation.)
32#-lispworks
33(deftest directory-namestring.3
34  (let* ((name "directory-namestring.lsp")
35         (pn (merge-pathnames (pathname name)))
36         (name2 (with-open-file (s pn :direction :input)
37                                (directory-namestring s)))
38         (name3 (directory-namestring pn)))
39    (or (equalt name2 name3) (list name2 name3)))
40  t)
41
42;;; Error tests
43
44(deftest directory-namestring.error.1
45  (signals-error (directory-namestring) program-error)
46  t)
47
48(deftest directory-namestring.error.2
49  (signals-error (directory-namestring "directory-namestring.lsp" nil) program-error)
50  t)
Note: See TracBrowser for help on using the repository browser.