find-relative-path: correct contract in docs
Also, avoid a test on Windows that can't work there.
This commit is contained in:
parent
7939e32a57
commit
eb24c1e0b1
|
@ -696,7 +696,7 @@ no extension, @racket[#f] is returned.}
|
|||
[path (or/c path-string? path-for-some-system?)]
|
||||
[#:more-than-root? more-than-root? any/c #f]
|
||||
[#:normalize-case? normalize-case? any/c #t])
|
||||
path-for-some-system?]{
|
||||
(or/c path-for-some-system? path-string?)]{
|
||||
|
||||
Finds a relative pathname with respect to @racket[base] that names the
|
||||
same file or directory as @racket[path]. Both @racket[base] and
|
||||
|
@ -707,7 +707,9 @@ common with @racket[base], @racket[path] is returned.
|
|||
If @racket[more-than-root?] is true, if @racket[base] and
|
||||
@racket[path] share only a Unix root in common, and if neither
|
||||
@racket[base] nor @racket[path] is just a root path, then
|
||||
@racket[path] is returned.
|
||||
@racket[path] is returned. The case when @racket[path] is returned
|
||||
and is a string is the only case when @racket[find-relative-path]
|
||||
returns a string result.
|
||||
|
||||
If @racket[normalize-case?] is true (the default), then pairs of path
|
||||
elements to be compared are first converted via
|
||||
|
|
|
@ -86,7 +86,10 @@
|
|||
#:more-than-root? #t))
|
||||
(test (bytes->path #"../.." 'unix) 'find-relative-path (find-relative-path (bytes->path #"/r/c" 'unix) (bytes->path #"/" 'unix)
|
||||
#:more-than-root? #t))
|
||||
(test "/" 'find-relative-path (find-relative-path "/" "/" #:more-than-root? #t))
|
||||
|
||||
(when (eq? 'unix (system-path-convention-type))
|
||||
(test "/" 'find-relative-path (find-relative-path "/" "/" #:more-than-root? #t))
|
||||
(test "/b" 'find-relative-path (find-relative-path "/a" "/b" #:more-than-root? #t)))
|
||||
|
||||
(test (bytes->path #"..\\b\\a" 'windows) find-relative-path (bytes->path #"C:/r/c" 'windows) (bytes->path #"c:/R/b/a" 'windows))
|
||||
(test (bytes->path #"..\\b\\a" 'windows) find-relative-path (bytes->path #"C:/r/c" 'windows) (bytes->path #"c:/r/b/a" 'windows))
|
||||
|
|
Loading…
Reference in New Issue
Block a user