X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fpathnames.impure.lisp;h=c85df934a49421668302ff5bc46e1e51c846a2e5;hb=4cf50b1896b25f5337e7c258b0b560da00d47993;hp=7fd7e3ac3d23306a07215e7867dbd64b2c697da4;hpb=64bf93a97814ea1caf62bbdcc7ef43e2fbfc8f73;p=sbcl.git diff --git a/tests/pathnames.impure.lisp b/tests/pathnames.impure.lisp index 7fd7e3a..c85df93 100644 --- a/tests/pathnames.impure.lisp +++ b/tests/pathnames.impure.lisp @@ -16,11 +16,7 @@ (in-package "CL-USER") -;;(eval-when (:compile-toplevel :load-toplevel :execute) - (defmacro grab-condition (&body body) - `(nth-value 1 - (ignore-errors ,@body))) -;;) +(load "assertoid.lisp") (setf (logical-pathname-translations "demo0") '(("**;*.*.*" "/tmp/"))) @@ -58,7 +54,7 @@ ;;; handle the following case exactly (otherwise we get an error: ;;; "#'IDENTITY CALLED WITH 2 ARGS." (setf (logical-pathname-translations "demo2") - '(("test;**;*.*" "/tmp/demo2/test/"))) + '(("test;**;*.*" "/tmp/demo2/test"))) (enough-namestring "demo2:test;foo.lisp") ;;; When a pathname comes from a logical host, it should be in upper @@ -102,13 +98,18 @@ (let ((cond (grab-condition (logical-pathname-translations "unregistered-host")))) (assert (typep cond 'type-error))) -;;; examples from CLHS: Section 19.4, Logical Pathname Translations -;;; (sometimes converted to the Un*x way of things) +;;; FIXME: A comment on this section up to sbcl-0.6.11.30 or so said +;;; examples from CLHS: Section 19.4, LOGICAL-PATHNAME-TRANSLATIONS +;;; (sometimes converted to the Un*x way of things) +;;; but when I looked it up I didn't see the connection. Presumably +;;; there's some code in this section which should be attributed +;;; to something in the ANSI spec, but I don't know what code it is +;;; or what section of the specification has the related code. (setf (logical-pathname-translations "test0") '(("**;*.*.*" "/library/foo/**/"))) (assert (equal (namestring (translate-logical-pathname - "test0:foo;bar;baz;mum.quux.3")) - "/library/foo/foo/bar/baz/mum.quux.3")) + "test0:foo;bar;baz;mum.quux")) + "/library/foo/foo/bar/baz/mum.quux")) (setf (logical-pathname-translations "prog") '(("RELEASED;*.*.*" "MY-UNIX:/sys/bin/my-prog/") ("RELEASED;*;*.*.*" "MY-UNIX:/sys/bin/my-prog/*/") @@ -126,6 +127,12 @@ "prog:code;documentation.lisp")) "/lib/prog/docum.lisp")) +;;; ANSI section 19.3.1.1.5 specifies that translation to a filesystem +;;; which doesn't have versions should ignore the version slot. CMU CL +;;; didn't ignore this as it should, but we do. +(assert (equal (namestring (translate-logical-pathname + "test0:foo;bar;baz;mum.quux.3")) + "/library/foo/foo/bar/baz/mum.quux")) + ;;; success (quit :unix-status 104) -(in-package :cl-user)