Make the nearest file search result absolute paths, and add tests to cover it.
This commit is contained in:
11
test/test_nearest_file_search.vader
Normal file
11
test/test_nearest_file_search.vader
Normal file
@@ -0,0 +1,11 @@
|
||||
Execute(Open a file some directory down):
|
||||
silent! cd /testplugin/test
|
||||
:e! top/middle/bottom/dummy.txt
|
||||
|
||||
Then(We should be able to find a configuration file further up):
|
||||
AssertEqual expand('%:p:h:h:h:h') . '/top/example.ini', ale#util#FindNearestFile(bufnr('%'), 'example.ini')
|
||||
|
||||
Execute(Do nothing):
|
||||
|
||||
Then(We shouldn't find anything for files which don't match):
|
||||
AssertEqual '', ale#util#FindNearestFile(bufnr('%'), 'cantfindthis')
|
||||
0
test/top/example.ini
Normal file
0
test/top/example.ini
Normal file
0
test/top/middle/bottom/dummy.txt
Normal file
0
test/top/middle/bottom/dummy.txt
Normal file
Reference in New Issue
Block a user