pathname-match-p.5 and 6 assume NIL in wild pathname means :wild?
These two tests are:
(deftest pathname-match-p.5
(let ((pn1 (make-pathname :directory '(:relative :wild)))
(pn2 (make-pathname :directory nil)))
(and (wild-pathname-p pn1)
(not (pathname-directory pn2))
(not (pathname-match-p pn1 pn2))))
nil)
(deftest pathname-match-p.6
(let ((pn1 (make-pathname :version :wild))
(pn2 (make-pathname)))
(and (wild-pathname-p pn1)
(not (pathname-version pn2))
(not (pathname-match-p pn1 pn2))))
nil)
For these tests to return NIL
, (pathname-match-p pn1 pn2)
must
return true.
IIUC, that would mean for test 5 that a directory of '(:relative :wild)
is expected to match a wild pathname with a directory of
NIL
. Similarly for test 6, a version of :WILD
is expected to
match a wild pathname with a version of NIL
.
I don't see how that can work unless you expected NIL
in a wild
pathname to be filled with :WILD
. That's not really clear from the
spec, as mentioned in
!53 (comment 10690).
Or is the test incorrect and it's really supposed to say
(pathname-match-p pn2 pn1)
instead of (pathname-match-p pn1 pn2)
.
(Reversing the argument order.) The former is kind of suggested because
there's a test that pn1
is a wild pathname, not for pn2
, and the
second arg of pathname-match-p
is the wild pathname.
I noticed this while modifying cmucl's directory
to use
pathname-match-p
to make sure the two are consistent. Part of the
change was not causing NIL
components to be filled by :WILD
components.