Fixing path-only documentation and adding new test case

(cherry picked from commit 5417d7a5b7)
This commit is contained in:
Jay McCarthy 2010-07-19 13:54:54 -06:00 committed by Eli Barzilay
parent 38acb4b9a9
commit 1f383eb5c7
2 changed files with 4 additions and 2 deletions

View File

@ -556,11 +556,12 @@ path contains an embedded path for a non-existent directory,
or if an infinite cycle of soft links is detected.}
@defproc[(path-only [path (or/c path-string? path-for-some-system?)])
path-for-some-system?]{
(or/c #f path-for-some-system?)]{
If @racket[path] is a filename, the file's path is returned. If
@racket[path] is syntactically a directory, @racket[path] is returned
(as a path, if it was a string).}
(as a path, if it was a string). If @racket[path] has no directory part
@racket[#f] is returned.}
@defproc[(simple-form-path [path path-string?]) path?]{

View File

@ -52,6 +52,7 @@
;; ----------------------------------------
(rtest path-only "a" #f)
(rtest path-only "a/b" (string->path "a/"))
(rtest path-only "a/b/" (string->path "a/b/"))
(rtest path-only "a/.." (string->path "a/.."))