print-pathname.lsp 1.17 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5 6 7 8 9 10 11
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Tue May 25 08:22:03 2004
;;;; Contains: Printer tests for pathnames

(in-package :cl-test)

(compile-and-load "printer-aux.lsp")

(deftest print.pathname.1
  (loop for p in *universe*
sds's avatar
sds committed
12 13 14 15 16
        when (typep p 'pathname)
        nconc
        (loop repeat 10
              nconc (randomly-check-readability p :test #'is-similar
                                                :can-fail t)))
pfdietz's avatar
pfdietz committed
17 18 19 20
  nil)

(deftest print.pathname.2
  (loop for p in *universe*
sds's avatar
sds committed
21 22 23 24 25 26
        when (typep p 'pathname)
        nconc
        (let ((ns (ignore-errors (namestring p))))
          "Read 22.1.3.11 before commenting on this test"
          (when ns
            (let ((expected-result
27 28
                   (concatenate 'string "#P"
                                (with-standard-io-syntax
sds's avatar
sds committed
29 30 31 32 33 34
                                 (write-to-string ns :readably nil
                                                  :escape t))))
                  (result (with-standard-io-syntax
                           (write-to-string p :readably nil :escape t))))
              (unless (string= expected-result result)
                (list (list expected-result result)))))))
pfdietz's avatar
pfdietz committed
35
  nil)