2017-07-26 09:37:37 +00:00
|
|
|
Execute(ale#path#ToURI should work for Windows paths):
|
|
|
|
AssertEqual 'file:///C:/foo/bar/baz.tst', ale#path#ToURI('C:\foo\bar\baz.tst')
|
|
|
|
AssertEqual 'foo/bar/baz.tst', ale#path#ToURI('foo\bar\baz.tst')
|
|
|
|
|
2019-02-21 19:47:22 +00:00
|
|
|
Execute(ale#path#FromURI should work for Unix paths):
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromURI('file:///foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromURI('file:/foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromURI('FILE:///foo/bar/baz.tst')
|
|
|
|
AssertEqual '/foo/bar/baz.tst', ale#path#FromURI('FILE:/foo/bar/baz.tst')
|
|
|
|
|
2017-11-20 00:02:33 +00:00
|
|
|
Execute(ale#path#FromURI should work for Windows paths):
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromURI('file:///C:/foo/bar/baz.tst')
|
2019-02-21 19:47:22 +00:00
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromURI('file:/C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromURI('file:///c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'c:\foo\bar\baz.tst', ale#path#FromURI('file:/c:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromURI('FILE:///C:/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'C:\foo\bar\baz.tst', ale#path#FromURI('FILE:/C:/foo/bar/baz.tst')
|
|
|
|
|
|
|
|
Execute(ale#path#FromURI should handle encoded paths that look like drive letters):
|
|
|
|
AssertEqual '/C:/foo/bar/baz.tst', ale#path#FromURI('file:///C%3A/foo/bar/baz.tst')
|
2017-11-20 00:02:33 +00:00
|
|
|
|
2017-07-26 09:37:37 +00:00
|
|
|
Execute(ale#path#ToURI should work for Unix paths):
|
|
|
|
AssertEqual 'file:///foo/bar/baz.tst', ale#path#ToURI('/foo/bar/baz.tst')
|
|
|
|
AssertEqual 'foo/bar/baz.tst', ale#path#ToURI('foo/bar/baz.tst')
|
|
|
|
|
|
|
|
Execute(ale#path#ToURI should keep safe characters):
|
|
|
|
AssertEqual '//a-zA-Z0-9$-_.!*''(),', ale#path#ToURI('\/a-zA-Z0-9$-_.!*''(),')
|
|
|
|
|
|
|
|
Execute(ale#path#ToURI should percent encode unsafe characters):
|
|
|
|
AssertEqual '%20%2b%3a%3f%26%3d', ale#path#ToURI(' +:?&=')
|
|
|
|
|
|
|
|
Execute(ale#path#FromURI should decode percent encodings):
|
|
|
|
AssertEqual ' +:?&=', ale#path#FromURI('%20%2b%3a%3f%26%3d')
|