2017-04-29 17:03:08 +00:00
|
|
|
Execute(ale#path#IsBufferPath should match simple relative paths):
|
2017-06-25 12:56:51 +00:00
|
|
|
call ale#test#SetFilename('app/foo.txt')
|
|
|
|
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), 'app/foo.txt'), 'No match for foo.txt'
|
|
|
|
Assert !ale#path#IsBufferPath(bufnr(''), 'app/bar.txt'), 'Bad match for bar.txt'
|
|
|
|
|
|
|
|
Execute(ale#path#IsBufferPath should match relative paths with dots):
|
|
|
|
call ale#test#SetFilename('app/foo.txt')
|
2017-04-29 17:03:08 +00:00
|
|
|
|
2017-06-25 12:56:51 +00:00
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '../../app/foo.txt'), 'No match for ../../app/foo.txt'
|
2017-04-29 17:03:08 +00:00
|
|
|
|
|
|
|
Execute(ale#path#IsBufferPath should match absolute paths):
|
|
|
|
silent file! foo.txt
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
2017-06-06 19:08:19 +00:00
|
|
|
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):
|
2017-04-29 17:03:08 +00:00
|
|
|
silent file! foo.txt
|
|
|
|
|
2017-06-06 19:08:19 +00:00
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '////foo.txt'), 'No match for foo.txt'
|
2017-06-22 11:37:08 +00:00
|
|
|
|
|
|
|
Execute(ale#path#IsBufferPath should accept various names for stdin):
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '-')
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), 'stdin')
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '<stdin>')
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '<somethingelse>')
|
2017-06-25 12:56:51 +00:00
|
|
|
|
|
|
|
Execute(ale#path#IsBufferPath should match files in /tmp):
|
|
|
|
call ale#test#SetFilename('app/test.ts')
|
|
|
|
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '../../../../../../../../tmp/vG0hKyD/1/test.ts')
|
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '/tmp/vG0hKyD/1/test.ts')
|
2017-06-25 16:08:57 +00:00
|
|
|
Assert ale#path#IsBufferPath(bufnr(''), '/run/user/1000/vG0hKyD/1/test.ts')
|