summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_find_nearest_directory.vader15
-rw-r--r--test/test_mypy_handler.vader22
-rw-r--r--test/test_resolve_local_path.vader2
-rw-r--r--test/top/ale-special-directory-name-dont-use-this-please/empty-file0
4 files changed, 38 insertions, 1 deletions
diff --git a/test/test_find_nearest_directory.vader b/test/test_find_nearest_directory.vader
new file mode 100644
index 00000000..450826ed
--- /dev/null
+++ b/test/test_find_nearest_directory.vader
@@ -0,0 +1,15 @@
+Execute(Open a file some directory down):
+ silent! cd /testplugin/test
+ :e! top/middle/bottom/dummy.txt
+
+Then(We should be able to find the right directory):
+ AssertEqual
+ \ expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/',
+ \ ale#util#FindNearestDirectory(bufnr('%'), 'ale-special-directory-name-dont-use-this-please')
+
+Execute(Do nothing):
+
+Then(We shouldn't find anything for files which don't match):
+ AssertEqual
+ \ '',
+ \ ale#util#FindNearestDirectory(bufnr('%'), 'ale-this-should-never-match-anything')
diff --git a/test/test_mypy_handler.vader b/test/test_mypy_handler.vader
new file mode 100644
index 00000000..5fe17f75
--- /dev/null
+++ b/test/test_mypy_handler.vader
@@ -0,0 +1,22 @@
+Execute(The mypy handler should parse lines correctly):
+ runtime ale_linters/python/mypy.vim
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 4,
+ \ 'vcol': 0,
+ \ 'col': 0,
+ \ 'text': "No library stub file for module 'django.db'",
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ },
+ \ ],
+ \ ale_linters#python#mypy#Handle(347, [
+ \ "file.py:4: error: No library stub file for module 'django.db'",
+ \ 'file.py:4: note: (Stub files are from https://github.com/python/typeshed)',
+ \ ])
+
+After:
+ call ale#linter#Reset()
diff --git a/test/test_resolve_local_path.vader b/test/test_resolve_local_path.vader
index bdbac01b..e269221e 100644
--- a/test/test_resolve_local_path.vader
+++ b/test/test_resolve_local_path.vader
@@ -2,7 +2,7 @@ Execute(Open a file some directory down):
silent! cd /testplugin/test
:e! top/middle/bottom/dummy.txt
-Then(We should be able to to find the local version of a file):
+Then(We should be able to find the local version of a file):
AssertEqual
\ expand('%:p:h:h:h:h') . '/top/example.ini',
\ ale#util#ResolveLocalPath(bufnr('%'), 'example.ini', '/global/config.ini')
diff --git a/test/top/ale-special-directory-name-dont-use-this-please/empty-file b/test/top/ale-special-directory-name-dont-use-this-please/empty-file
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/top/ale-special-directory-name-dont-use-this-please/empty-file