diff options
author | w0rp <devw0rp@gmail.com> | 2017-06-06 20:08:19 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-06-06 20:08:19 +0100 |
commit | 7db805b0cd1367ebf866e0c149fd819e425f6e0d (patch) | |
tree | 9d2569819a21c2e8b0d82218120821eb2a67cccb /test/test_path_equality.vader | |
parent | ef86a8a389842b4de5196bd458e2014bc63da238 (diff) | |
download | ale-7db805b0cd1367ebf866e0c149fd819e425f6e0d.zip |
#482 - Fix Flow handling with relative paths
Diffstat (limited to 'test/test_path_equality.vader')
-rw-r--r-- | test/test_path_equality.vader | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/test/test_path_equality.vader b/test/test_path_equality.vader index b1f06967..5d92794f 100644 --- a/test/test_path_equality.vader +++ b/test/test_path_equality.vader @@ -1,18 +1,3 @@ -Execute(ale#path#GetAbsPath should handle simple relative paths): - AssertEqual '/foo/bar', ale#path#GetAbsPath('/foo', 'bar') - AssertEqual 'C:\foo/bar', ale#path#GetAbsPath('C:\foo', 'bar') - AssertEqual getcwd() . '/foo/bar', ale#path#GetAbsPath('foo', 'bar') - -Execute(ale#path#GetAbsPath should handle relative paths with dots): - AssertEqual '/foo/baz', ale#path#GetAbsPath('/foo', 'bar/sub/../../baz') - AssertEqual '/foo/baz', ale#path#GetAbsPath('/foo/', 'bar/sub/../../baz') - AssertEqual '/foo/other', ale#path#GetAbsPath('/foo/bar', '../other') - AssertEqual '/foo/other', ale#path#GetAbsPath('/foo/bar/', '../other') - -Execute(ale#path#GetAbsPath should handle absolute paths): - AssertEqual '/foo/bar', ale#path#GetAbsPath('/something else', '/foo/bar') - AssertEqual 'C:\foo/bar', ale#path#GetAbsPath('D:\another thing', 'C:\foo/bar') - Execute(ale#path#IsBufferPath should match simple relative paths): silent file! foo.txt @@ -25,7 +10,17 @@ Execute(ale#path#IsBufferPath should match absolute paths): Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '/foo.txt'), 'No match for foo.txt' Assert !ale#path#IsBufferPath(bufnr(''), getcwd() . '/bar.txt'), 'Bad match for bar.txt' -Execute(ale#path#IsBufferPath should match paths with dots): +Execute(ale#path#IsBufferPath should match paths beginning with ./): + silent file! foo.txt + + Assert ale#path#IsBufferPath(bufnr(''), './foo.txt'), 'No match for ./foo.txt' + +Execute(ale#path#IsBufferPath should match if our path ends with the test path): + silent file! foo/bar/baz.txt + + Assert ale#path#IsBufferPath(bufnr(''), 'bar/baz.txt'), 'No match for bar/baz.txt' + +Execute(ale#path#IsBufferPath should match paths with redundant slashes): silent file! foo.txt - Assert ale#path#IsBufferPath(bufnr(''), './test/../foo.txt'), 'No match for ./test/../foo.txt' + Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '////foo.txt'), 'No match for foo.txt' |