host-namestring.lsp 1.24 KB
Newer Older
1
2
3
4
5
6
7
8
9
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun Sep 12 06:22:40 2004
;;;; Contains: Tests of HOST-NAMESTRING

(in-package :cl-test)

(deftest host-namestring.1
  (let* ((vals (multiple-value-list
sds's avatar
sds committed
10
11
                (host-namestring "host-namestring.lsp")))
         (s (first vals)))
12
    (if (and (null (cdr vals))
sds's avatar
sds committed
13
14
15
16
17
             (or (null s)
                 (stringp s)
                 ;; (equal (host-namestring s) s)
                 ))
        :good
18
19
20
21
22
23
24
      vals))
  :good)

(deftest host-namestring.2
  (do-special-strings
   (s "host-namestring.lsp" nil)
   (let ((ns (host-namestring s)))
pfdietz's avatar
pfdietz committed
25
26
     (when ns
       (assert (stringp ns))
27
28
       ;; (assert (string= (host-namestring ns) ns))
       )))
29
30
31
32
  nil)

(deftest host-namestring.3
  (let* ((name "host-namestring.lsp")
sds's avatar
sds committed
33
34
35
36
         (pn (merge-pathnames (pathname name)))
         (name2 (with-open-file (s pn :direction :input)
                                (host-namestring s)))
         (name3 (host-namestring pn)))
37
38
39
40
41
42
43
44
45
46
47
48
49
    (or (equalt name2 name3) (list name2 name3)))
  t)

;;; Error tests

(deftest host-namestring.error.1
  (signals-error (host-namestring) program-error)
  t)

(deftest host-namestring.error.2
  (signals-error (host-namestring "host-namestring.lsp" nil) program-error)
  t)