Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Moringen
asdf
Commits
dc506a1d
Commit
dc506a1d
authored
11 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
More pathname tweaks, found thanks to LispWorks, CMUCL.
parent
2a48eb41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test-utilities.script
+5
-6
5 additions, 6 deletions
test/test-utilities.script
uiop/pathname.lisp
+5
-4
5 additions, 4 deletions
uiop/pathname.lisp
with
10 additions
and
10 deletions
test/test-utilities.script
+
5
−
6
View file @
dc506a1d
...
...
@@ -3,13 +3,10 @@
(assert
(every #'directory-pathname-p
(list
(make-pathname* :name nil :type "" :directory '(:absolute "tmp"))
(make-pathname* :name "" :directory '(:absolute "tmp"))
(make-pathname* :type "" :directory '(:absolute "tmp"))
;; CLHS 19.2.2.2.3 says we can't portably specify :unspecific here,
;; and some implementations will enforce it.
(make-pathname* :name nil :type nil :directory '(:absolute "tmp"))
;; CLHS 19.2.2.2.3 says we can't portably specify :unspecific here,
;; and some implementations will enforce it.
(make-pathname* :type *unspecific-pathname-type* :directory '(:absolute "tmp"))
(make-pathname* :name *unspecific-pathname-type* :directory '(:absolute "tmp"))
(make-pathname* :name *unspecific-pathname-type* :directory '(:absolute "tmp")))))
(assert
(every (complement #'directory-pathname-p)
...
...
@@ -17,6 +14,8 @@
(make-pathname* :name "foo" :type nil :directory '(:absolute "tmp"))
(make-pathname* :name nil :type "bar" :directory '(:absolute "tmp")))))
;; These are funky and non portable, omit from tests:
;; (make-pathname* :name "" :type nil :directory '(:absolute "tmp"))
;; (make-pathname* :name nil :type "" :directory '(:absolute "tmp"))
;; (make-pathname* :name "." :type nil :directory '(:absolute "tmp"))
;; (make-pathname* :name "." :type "" :directory '(:absolute "tmp"))
(macrolet ((ts (x y)
...
...
This diff is collapsed.
Click to expand it.
uiop/pathname.lisp
+
5
−
4
View file @
dc506a1d
...
...
@@ -307,7 +307,7 @@ actually-existing directory."
;; ill-formed. [2014/02/10:rpg]
(
let
((
pathname
(
pathname
pathname
)))
(
flet
((
check-one
(
x
)
(
member
x
'
(
nil
:unspecific
""
)
:test
'equal
)))
(
member
x
'
(
nil
:unspecific
)
:test
'equal
)))
(
and
(
not
(
wild-pathname-p
pathname
))
(
check-one
(
pathname-name
pathname
))
(
check-one
(
pathname-type
pathname
))
...
...
@@ -483,13 +483,14 @@ or if it is a PATHNAME but some of its components are not recognized."
((
or
null
string
)
pathname
)
(
pathname
(
with-output-to-string
(
s
)
(
flet
((
err
()
(
error
"Not a valid unix-namestring ~S"
pathname
)))
(
flet
((
err
()
#+
lispworks
(
describe
pathname
)
(
error
"Not a valid unix-namestring ~S"
pathname
)))
(
let*
((
dir
(
normalize-pathname-directory-component
(
pathname-directory
pathname
)))
(
name
(
pathname-name
pathname
))
(
name
(
and
(
not
(
eq
name
:unspecific
))
name
))
(
type
(
pathname-type
pathname
))
(
type
(
and
(
not
(
eq
type
:unspecific
))
type
)))
(
cond
((
eq
dir
(
)))
((
member
dir
'
(
nil
:unspecific
)))
((
eq
dir
'
(
:relative
))
(
princ
"./"
s
))
((
consp
dir
)
(
destructuring-bind
(
relabs
&rest
dirs
)
dir
...
...
@@ -505,7 +506,7 @@ or if it is a PATHNAME but some of its components are not recognized."
(
t
(
err
)))
(
cond
(
name
(
or
(
and
(
stringp
name
)
(
or
(
null
type
)
(
stringp
type
)))
(
err
))
(
unless
(
and
(
stringp
name
)
(
or
(
null
type
)
(
stringp
type
)))
(
err
))
(
format
s
"~A~@[.~A~]"
name
type
))
(
t
(
or
(
null
type
)
(
err
)))))))))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment