blob: 08654b3fe5287df8683769c414c2b741081d29aa [file] [log] [blame]
Canonicalization of file URLs when the base URL is an http URL
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
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:////foo/bar.html. Was file:///c%7C////foo/bar.html.
PASS canonicalize('file:') is 'file:///'
FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file:///UNChost/path.
FAIL canonicalize('c:\\foo\\bar') should be file:///C:/foo/bar. Was c:\foo\bar.
FAIL canonicalize('C|/foo/bar') should be file:///C:/foo/bar. Was http://example.com/mock/C%7C/foo/bar.
FAIL canonicalize('/C|\\foo\\bar') should be file:///C:/foo/bar. Was http://example.com/C%7C/foo/bar.
FAIL canonicalize('//C|/foo/bar') should be file:///C:/foo/bar. Was http://c%7C/foo/bar.
FAIL canonicalize('//server/file') should be file://server/file. Was http://server/file.
FAIL canonicalize('\\\\server\\file') should be file://server/file. Was http://server/file.
FAIL canonicalize('/\\server/file') should be file://server/file. Was http://server/file.
FAIL canonicalize('file:c:foo/bar.html') should be file:///C:/foo/bar.html. Was 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'
FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:///7:////foo/bar.html.
FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///filer/home/me.
FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
PASS canonicalize('file:///C:/asdf#\xc2') is 'file:///C:/asdf#%C3%82'
PASS canonicalize('file:///C:/asdf#Â') is 'file:///C:/asdf#%C3%82'
PASS canonicalize('file:///home/me') is 'file:///home/me'
PASS canonicalize('file:c:\\foo\\bar.html') is 'file:///c:/foo/bar.html'
PASS canonicalize('file:c|//foo\\bar.html') is 'file:///c%7C//foo/bar.html'
FAIL canonicalize('//') should be file:///. Was http:.
FAIL canonicalize('///') should be file:///. Was http:.
FAIL canonicalize('///test') should be file:///test. Was http://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