source: trunk/source/tests/ansi-tests/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.9 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Sep  2 07:24:42 2004
4;;;; Contains: Tests for NAMESTRING
5
6(in-package :cl-test)
7
8(deftest namestring.1
9  (let* ((vals (multiple-value-list (namestring "namestring.lsp")))
10         (s (first vals)))
11    (if (and (null (cdr vals))
12             (stringp s)
13             (equal (namestring s) s))
14        :good
15      vals))
16  :good)
17
18(deftest namestring.2
19  (do-special-strings
20   (s "namestring.lsp" nil)
21   (let ((ns (namestring s)))
22     (assert (stringp ns))
23     (assert (string= (namestring ns) ns))))
24  nil)
25
26;;; I'm not convinced these tested required behavior, so I'm commenting
27;;; them out for now.  FIXME: determine if they are bogus
28#|
29(deftest namestring.3
30  (let* ((name "namestring.lsp")
31         (pn (merge-pathnames (pathname name)))
32         (name2 (namestring pn))
33         (pn2 (pathname name2)))
34    (or (equalt pn pn2) (list (list pn (pathname-host pn) (pathname-device pn)
35                                    (pathname-directory pn) (pathname-name pn)
36                                    (pathname-type pn) (pathname-version pn))
37                              (list pn2 (pathname-host pn2) (pathname-device pn2)
38                                    (pathname-directory pn2) (pathname-name pn2)
39                                    (pathname-type pn2) (pathname-version pn2)))))
40  t)
41
42(deftest namestring.4
43  (let* ((name "namestring.lsp")
44         (pn (merge-pathnames (pathname name)))
45         (name2 (with-open-file (s pn :direction :input) (namestring s)))
46         (pn2 (pathname name2)))
47    (or (equalt pn pn2) (list (list pn (pathname-host pn) (pathname-device pn)
48                                    (pathname-directory pn) (pathname-name pn)
49                                    (pathname-type pn) (pathname-version pn))
50                              (list pn2 (pathname-host pn2) (pathname-device pn2)
51                                    (pathname-directory pn2) (pathname-name pn2)
52                                    (pathname-type pn2) (pathname-version pn2)))))
53  t)
54|#
55
56;;; Error tests
57
58(deftest namestring.error.1
59  (signals-error (namestring) program-error)
60  t)
61
62(deftest namestring.error.2
63  (signals-error (namestring "namestring.lsp" nil) program-error)
64  t)
Note: See TracBrowser for help on using the repository browser.