summaryrefslogtreecommitdiff
path: root/test/test_path_uri.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-26 10:37:37 +0100
committerw0rp <devw0rp@gmail.com>2017-07-26 10:37:37 +0100
commitcd860e3e8d2b8d35920f27279bbd1ec346ac4d62 (patch)
tree03c63eb3e37d2e2b5761f3bbe3af7b1b0e8e05df /test/test_path_uri.vader
parent86297a7c65eadc5dc7668e129c92316aa0a89898 (diff)
downloadale-cd860e3e8d2b8d35920f27279bbd1ec346ac4d62.zip
#517 Add more code LSP support which makes the tssserver linter behave more like the LSP linters
Diffstat (limited to 'test/test_path_uri.vader')
-rw-r--r--test/test_path_uri.vader16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_path_uri.vader b/test/test_path_uri.vader
new file mode 100644
index 00000000..dbceac3a
--- /dev/null
+++ b/test/test_path_uri.vader
@@ -0,0 +1,16 @@
+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')
+
+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')