blob: 6c8cd6b4b4443053d60525e36956fee495b7b6f7 [file] [log] [blame]
Canonicalization of file URLs
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS canonicalize('file:c:\\foo\\bar.html') is 'file:///C:/foo/bar.html'
PASS canonicalize(' File:c|////foo\\bar.html') is 'file:///C:////foo/bar.html'
FAIL canonicalize('file:') should be file:///. Was file:///tmp/mock/path.
FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file:///tmp/mock/UNChost/path.
PASS canonicalize('c:\\foo\\bar') is 'file:///C:/foo/bar'
PASS canonicalize('C|/foo/bar') is 'file:///C:/foo/bar'
PASS canonicalize('/C|\\foo\\bar') is 'file:///C:/foo/bar'
PASS canonicalize('//C|/foo/bar') is 'file:///C:/foo/bar'
PASS canonicalize('//server/file') is 'file://server/file'
PASS canonicalize('\\\\server\\file') is 'file://server/file'
PASS canonicalize('/\\server/file') is 'file://server/file'
PASS canonicalize('file:c:foo/bar.html') is 'file:///C:/foo/bar.html'
PASS canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') is 'file:///C:////foo/bar.html'
PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
PASS canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') is 'file://7:////foo/bar.html'
FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///tmp/mock/filer/home/me.
PASS canonicalize('file:///C:/foo/../../../bar.html') is 'file:///C:/bar.html'
PASS canonicalize('file:///C:/asdf#\xc2') is 'file:///C:/asdf#%C3%82'
PASS canonicalize('file:///home/me') is 'file:///home/me'
FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///c:/foo/bar.html. Was file:///C:/foo/bar.html.
FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file:///C://foo/bar.html.
PASS canonicalize('//') is 'file:///'
PASS canonicalize('///') is 'file:///'
PASS canonicalize('///test') is 'file:///test'
PASS canonicalize('file://test') is 'file://test/'
PASS canonicalize('file://localhost') is 'file://localhost/'
PASS canonicalize('file://localhost/') is 'file://localhost/'
PASS canonicalize('file://localhost/test') is 'file://localhost/test'
PASS successfullyParsed is true
TEST COMPLETE