net/url and tests fixes for windows

svn: r9249
This commit is contained in:
Matthew Flatt 2008-04-11 01:12:01 +00:00
parent 18f4087673
commit 2dc02d81fe
2 changed files with 6 additions and 4 deletions

View File

@ -164,7 +164,7 @@
[else (build-path)]) ; error
(let ([elems (map string->path-element/same strs)])
(if (url-path-absolute? url)
(apply build-path "/" elems)
(apply build-path (bytes->path #"/" 'unix) elems)
(apply build-path elems))))))
;; file://get-pure-port : url -> in-port

View File

@ -282,10 +282,12 @@
(test-s->u #("file" #f "" #f #t (#("abc") #("def.html")) () #f)
"file:///abc/def.html")
(test "file:///abc/def.html" url->string (string->url "file:///abc/def.html"))
(test "file://a/b" url->string (string->url "file://a/b"))
(parameterize ([file-url-path-convention-type 'unix])
(test "file://a/b" url->string (string->url "file://a/b")))
(test-s->u #("file" #f "localhost" #f #t (#("abc") #("def.html")) () #f)
"file://localhost/abc/def.html")
(parameterize ([file-url-path-convention-type 'unix])
(test-s->u #("file" #f "localhost" #f #t (#("abc") #("def.html")) () #f)
"file://localhost/abc/def.html"))
;; test files: urls with colons, and the different parsing on Windows
(test-s->u #("file" #f "localhost" 123 #t (#("abc") #("def.html")) () #f)