2020-08-10 01:03:41 +00:00
|
|
|
Before:
|
|
|
|
scriptencoding utf-8
|
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#ToFileURI should work for Windows paths):
|
|
|
|
AssertEqual 'file:///C:/foo/bar/baz.tst', ale#path#ToFileURI('C:\foo\bar\baz.tst')
|
|
|
|
AssertEqual 'foo/bar/baz.tst', ale#path#ToFileURI('foo\bar\baz.tst')
|
2017-07-26 09:37:37 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI should work for Unix paths):
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromFileURI('file:///foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromFileURI('file:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromFileURI('FILE:///foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromFileURI('FILE:/foo/bar/baz.tst')
|
2019-02-21 19:47:22 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI should work for Windows paths):
|
2019-03-13 16:44:29 +00:00
|
|
|
if has('win32')
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('file:///C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('file:/C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromFileURI('file:///c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromFileURI('file:/c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('FILE:///C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('FILE:/C:/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
else
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromFileURI('file:///C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromFileURI('file:/C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/c:/foo/bar/baz.tst', ale#path#FromFileURI('file:///c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/c:/foo/bar/baz.tst', ale#path#FromFileURI('file:/c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromFileURI('FILE:///C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromFileURI('FILE:/C:/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
endif
|
2019-02-21 19:47:22 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI parse Windows paths with a pipe):
|
2019-03-13 16:44:29 +00:00
|
|
|
if has('win32')
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('file:///C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('file:/C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromFileURI('file:///c|/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromFileURI('file:/c|/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('FILE:///C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('FILE:/C|/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
else
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual '/C|/foo/bar/baz.tst', ale#path#FromFileURI('file:///C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C|/foo/bar/baz.tst', ale#path#FromFileURI('file:/C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/c|/foo/bar/baz.tst', ale#path#FromFileURI('file:///c|/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/c|/foo/bar/baz.tst', ale#path#FromFileURI('file:/c|/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C|/foo/bar/baz.tst', ale#path#FromFileURI('FILE:///C|/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/C|/foo/bar/baz.tst', ale#path#FromFileURI('FILE:/C|/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
endif
|
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI should handle the colon for the drive letter being encoded):
|
2019-03-13 16:44:29 +00:00
|
|
|
" These URIs shouldn't be created, but we'll handle them anyway.
|
|
|
|
if has('win32')
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromFileURI('file:///C%3A/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
else
|
2022-03-04 19:03:27 +00:00
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromFileURI('file:///C%3A/foo/bar/baz.tst')
|
2019-03-13 16:44:29 +00:00
|
|
|
endif
|
2017-11-20 00:02:33 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#ToFileURI should work for Unix paths):
|
|
|
|
AssertEqual 'file:///foo/bar/baz.tst', ale#path#ToFileURI('/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'foo/bar/baz.tst', ale#path#ToFileURI('foo/bar/baz.tst')
|
2017-07-26 09:37:37 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#ToFileURI should keep safe characters):
|
|
|
|
AssertEqual '//a-zA-Z0-9$-_.!*''(),', ale#path#ToFileURI('\/a-zA-Z0-9$-_.!*''(),')
|
2017-07-26 09:37:37 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#ToFileURI should percent encode unsafe characters):
|
|
|
|
AssertEqual '%20%2b%3a%3f%26%3d', ale#path#ToFileURI(' +:?&=')
|
2017-07-26 09:37:37 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI should decode percent encodings):
|
|
|
|
AssertEqual ' +:?&=', ale#path#FromFileURI('%20%2b%3a%3f%26%3d')
|
2020-08-10 01:03:41 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#ToFileURI should handle UTF-8):
|
|
|
|
AssertEqual 'file:///T%c3%a9l%c3%a9chargement', ale#path#ToFileURI('/Téléchargement')
|
2020-08-10 01:03:41 +00:00
|
|
|
|
2022-03-04 19:03:27 +00:00
|
|
|
Execute(ale#path#FromFileURI should handle UTF-8):
|
|
|
|
AssertEqual '/Téléchargement', ale#path#FromFileURI('file:///T%C3%A9l%C3%A9chargement')
|