source: trunk/source/tests/ansi-tests/file-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.1 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Sep 11 07:40:47 2004
4;;;; Contains: Tests for FILE-NAMESTRING
5
6(in-package :cl-test)
7
8(deftest file-namestring.1
9  (let* ((vals (multiple-value-list
10                (file-namestring "file-namestring.lsp")))
11         (s (first vals)))
12    (if (and (null (cdr vals))
13             (stringp s)
14             (equal (file-namestring s) s))
15        :good
16      vals))
17  :good)
18
19(deftest file-namestring.2
20  (do-special-strings
21   (s "file-namestring.lsp" nil)
22   (let ((ns (file-namestring s)))
23     (assert (stringp ns))
24     (assert (string= (file-namestring ns) ns))))
25  nil)
26
27(deftest file-namestring.3
28  (let* ((name "file-namestring.lsp")
29         (pn (merge-pathnames (pathname name)))
30         (name2 (with-open-file (s pn :direction :input)
31                                (file-namestring s)))
32         (name3 (file-namestring pn)))
33    (or (equalt name2 name3) (list name2 name3)))
34  t)
35
36;;; Error tests
37
38(deftest file-namestring.error.1
39  (signals-error (file-namestring) program-error)
40  t)
41
42(deftest file-namestring.error.2
43  (signals-error (file-namestring "file-namestring.lsp" nil) program-error)
44  t)
Note: See TracBrowser for help on using the repository browser.