Added path->url tests for directory paths

This check that no regression was introduced with 733d95b.

original commit: 201534b7ad
This commit is contained in:
Philippe Mechai 2012-11-07 08:29:35 +01:00 committed by Matthew Flatt
parent 0731559f69
commit 51f0506e7e

View File

@ -181,22 +181,40 @@
(test (string->url/vec "http://foo:/abc/def.html") (test (string->url/vec "http://foo:/abc/def.html")
=> #("http" #f "foo" #f #t (#("abc") #("def.html")) () #f))) => #("http" #f "foo" #f #t (#("abc") #("def.html")) () #f)))
(test (url->string (path->url (bytes->path #"c:\\a\\b" 'windows))) (test (url->string (path->url (bytes->path #"/a/b" 'unix)))
=> "file:///a/b"
(url->string (path->url (bytes->path #"/a/b/" 'unix)))
=> "file:///a/b/"
(url->string (path->url (bytes->path #"c:\\a\\b" 'windows)))
=> "file:///c:/a/b" => "file:///c:/a/b"
(url->string (path->url (bytes->path #"c:\\a\\b\\" 'windows)))
=> "file:///c:/a/b/"
(url->string (path->url (bytes->path #"\\\\?\\c:\\a\\b" 'windows))) (url->string (path->url (bytes->path #"\\\\?\\c:\\a\\b" 'windows)))
=> "file:///c:/a/b") => "file:///c:/a/b"
(url->string (path->url (bytes->path #"\\\\?\\c:\\a\\b\\" 'windows)))
=> "file:///c:/a/b/")
(test (test
(path->bytes (url->path (path->url (bytes->path #"/a/b/c" 'unix)) 'unix)) (path->bytes (url->path (path->url (bytes->path #"/a/b/c" 'unix)) 'unix))
=> #"/a/b/c" => #"/a/b/c"
(path->bytes (url->path (path->url (bytes->path #"/a/b/c/" 'unix)) 'unix))
=> #"/a/b/c/."
(path->bytes (url->path (path->url (bytes->path #"a/b/c" 'unix)) 'unix)) (path->bytes (url->path (path->url (bytes->path #"a/b/c" 'unix)) 'unix))
=> #"a/b/c" => #"a/b/c"
(path->bytes (url->path (path->url (bytes->path #"a/b/c/" 'unix)) 'unix))
=> #"a/b/c/."
(path->bytes (url->path (path->url (bytes->path #"c:/a/b" 'windows)) 'windows)) (path->bytes (url->path (path->url (bytes->path #"c:/a/b" 'windows)) 'windows))
=> #"c:\\a\\b" => #"c:\\a\\b"
(path->bytes (url->path (path->url (bytes->path #"c:/a/b/" 'windows)) 'windows))
=> #"c:\\a\\b\\."
(path->bytes (url->path (path->url (bytes->path #"a/b" 'windows)) 'windows)) (path->bytes (url->path (path->url (bytes->path #"a/b" 'windows)) 'windows))
=> #"a\\b" => #"a\\b"
(path->bytes (url->path (path->url (bytes->path #"a/b/" 'windows)) 'windows))
=> #"a\\b\\."
(path->bytes (url->path (path->url (bytes->path #"//d/c/a" 'windows)) 'windows)) (path->bytes (url->path (path->url (bytes->path #"//d/c/a" 'windows)) 'windows))
=> #"\\\\d\\c\\a" => #"\\\\d\\c\\a"
(path->bytes (url->path (path->url (bytes->path #"//d/c/a/" 'windows)) 'windows))
=> #"\\\\d\\c\\a\\."
(path->bytes (url->path (path->url (bytes->path #"\\\\?\\c:\\a\\b" 'windows)) 'windows)) (path->bytes (url->path (path->url (bytes->path #"\\\\?\\c:\\a\\b" 'windows)) 'windows))
=> #"c:\\a\\b" => #"c:\\a\\b"
(path->bytes (url->path (path->url (bytes->path #"\\\\?\\UNC\\d\\c\\a\\b" 'windows)) 'windows)) (path->bytes (url->path (path->url (bytes->path #"\\\\?\\UNC\\d\\c\\a\\b" 'windows)) 'windows))