file-expected.txt revision 2fc2651226baac27029e38c9d6ef883fa32084db
1Canonicalization of file URLs 2 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///C:/foo/bar.html. Was file:///tmp/mock/c:/foo/bar.html. 7FAIL canonicalize(' File:c|////foo\\bar.html') should be file:///C:////foo/bar.html. Was file:///tmp/mock/c|////foo/bar.html. 8FAIL canonicalize('file:') should be file:///. Was file:///tmp/mock/path. 9FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file:///tmp/mock/UNChost/path. 10FAIL canonicalize('c:\\foo\\bar') should be file:///C:/foo/bar. Was c:/foo/bar. 11FAIL canonicalize('C|/foo/bar') should be file:///C:/foo/bar. Was file:///tmp/mock/C|/foo/bar. 12FAIL canonicalize('/C|\\foo\\bar') should be file:///C:/foo/bar. Was file:///C|/foo/bar. 13FAIL canonicalize('//C|/foo/bar') should be file:///C:/foo/bar. Was file://C|/foo/bar. 14PASS canonicalize('//server/file') is 'file://server/file' 15PASS canonicalize('\\\\server\\file') is 'file://server/file' 16PASS canonicalize('/\\server/file') is 'file://server/file' 17FAIL canonicalize('file:c:foo/bar.html') should be file:///C:/foo/bar.html. Was file:///tmp/mock/c:foo/bar.html. 18FAIL canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') should be file:///C:////foo/bar.html. Was file:////C:////foo/bar.html. 19PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt' 20FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html. 21FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///tmp/mock/filer/home/me. 22FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html. 23FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#�. Was file:///C:/asdf#%C2. 24PASS canonicalize('file:///home/me') is 'file:///home/me' 25FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///c:/foo/bar.html. Was file:///tmp/mock/c:/foo/bar.html. 26FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file:///tmp/mock/c|//foo/bar.html. 27FAIL canonicalize('//') should be file:///. Was file:. 28PASS canonicalize('///') is 'file:///' 29PASS canonicalize('///test') is 'file:///test' 30FAIL canonicalize('file://test') should be file://test/. Was file://test. 31FAIL canonicalize('file://localhost') should be file://localhost/. Was file:. 32FAIL canonicalize('file://localhost/') should be file://localhost/. Was file:///. 33FAIL canonicalize('file://localhost/test') should be file://localhost/test. Was file:///test. 34PASS successfullyParsed is true 35 36TEST COMPLETE 37 38