From bad9a556183eeb5334a8fd7fe3722a6abd278a2a Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Sat, 10 Sep 2022 17:38:59 -0700 Subject: [PATCH 1/2] Fix #136: ensure-directories-exist should return the given pathspec The CLHS says The primary value is the given pathspec so that this operation can be straightforwardly composed with other file manipulation expressions. The ansi tests interpret this to mean that the first arg should be returned as is. Previously, Cmucl was merging the pathspec with `*default-pathname-defaults*` and returning that. --- src/code/filesys.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index 60f0afc36..74f7c3e3f 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -1474,4 +1474,4 @@ optionally keeping some of the most recent old versions." (retry () :report "Try to create the directory again" (go retry)))))) ;; Only the first path in a search-list is considered. - (return (values pathname created-p)))))) + (return (values pathspec created-p)))))) -- GitLab From c59de890d9e63d007d56ac32a93d55424cf57f2c Mon Sep 17 00:00:00 2001 From: Raymond Toy Date: Sat, 10 Sep 2022 20:20:54 -0700 Subject: [PATCH 2/2] Update tests for change in ensure-directories-exist The tests here assumed that `ensure-directories-exits` would return a pathname object. But it doesn't anymore; it returns the given pathspec as is. --- tests/filesys.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/filesys.lisp b/tests/filesys.lisp index a3d99e807..1e38003c9 100644 --- a/tests/filesys.lisp +++ b/tests/filesys.lisp @@ -10,7 +10,7 @@ (define-test unix-namestring.1.exists ;; Make sure the desired directories exist. - (assert-equal #P"/tmp/foo/bar/hello.txt" + (assert-equal "/tmp/foo/bar/hello.txt" (ensure-directories-exist "/tmp/foo/bar/hello.txt")) (dolist (path '("/tmp/hello.txt" "/tmp/foo/" @@ -27,7 +27,7 @@ (define-test unix-namestring.1.non-existent ;; Make sure the desired directories exist. - (assert-equal #P"/tmp/foo/bar/hello.txt" + (assert-equal "/tmp/foo/bar/hello.txt" (ensure-directories-exist "/tmp/foo/bar/hello.txt")) ;; These paths contain directories that don't exist. (dolist (path '("/tmp/oops/" @@ -42,7 +42,7 @@ (define-test unix-namestring.2 ;; Make sure the desired directories exist. - (assert-equal #P"/tmp/foo/bar/hello.txt" + (assert-equal "/tmp/foo/bar/hello.txt" (ensure-directories-exist "/tmp/foo/bar/hello.txt")) (unwind-protect (progn -- GitLab