summaryrefslogtreecommitdiff
path: root/test/linter
diff options
context:
space:
mode:
authorDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2022-10-29 14:58:30 +0300
committerGitHub <noreply@github.com>2022-10-29 20:58:30 +0900
commit06efbdd25a3a8cccf17692f7bd4eac71ae7d6e05 (patch)
tree1dd9b115516660f1f6cf3659ac87f2b8328b5b76 /test/linter
parentd02e58b4043001c8338583070fb2d85f52f232d6 (diff)
downloadale-06efbdd25a3a8cccf17692f7bd4eac71ae7d6e05.zip
Add erlang_ls linter for Erlang files (#4346)
Diffstat (limited to 'test/linter')
-rw-r--r--test/linter/test_erlang_erlang_ls.vader48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/linter/test_erlang_erlang_ls.vader b/test/linter/test_erlang_erlang_ls.vader
new file mode 100644
index 00000000..3870b5c4
--- /dev/null
+++ b/test/linter/test_erlang_erlang_ls.vader
@@ -0,0 +1,48 @@
+Before:
+ let b:files = '../test-files/erlang'
+ call ale#assert#SetUpLinterTest('erlang', 'erlang_ls')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default command should be correct):
+ AssertLinter 'erlang_ls',
+ \ ale#Escape('erlang_ls') . ' --log-level=' . ale#Escape('info')
+
+Execute(Executable should be configurable):
+ let b:ale_erlang_erlang_ls_executable = '/path/to/erlang_ls'
+
+ AssertLinter '/path/to/erlang_ls',
+ \ ale#Escape('/path/to/erlang_ls') . ' --log-level=' . ale#Escape('info')
+
+Execute(Log level should be configurable):
+ let b:ale_erlang_erlang_ls_log_level = 'debug'
+
+ AssertLinter 'erlang_ls',
+ \ ale#Escape('erlang_ls') . ' --log-level=' . ale#Escape('debug')
+
+Execute(Log directory should be configurable):
+ let b:ale_erlang_erlang_ls_log_dir = '/path/to/logs'
+
+ AssertLinter 'erlang_ls',
+ \ ale#Escape('erlang_ls')
+ \ . ' --log-dir=' . ale#Escape('/path/to/logs')
+ \ . ' --log-level=' . ale#Escape('info')
+
+Execute(Project root should be detected using erlang_ls.config):
+ call ale#test#SetFilename(b:files . '/app_with_erlang_ls_config/src/app.erl')
+ AssertLSPProject ale#test#GetFilename(b:files . '/app_with_erlang_ls_config')
+
+ call ale#test#SetFilename(b:files . '/app_with_erlang_ls_config/_build/default/lib/dep/src/dep.erl')
+ AssertLSPProject ale#test#GetFilename(b:files . '/app_with_erlang_ls_config')
+
+Execute(Root of Rebar3 project should be detected):
+ call ale#test#SetFilename(b:files . '/app/src/app.erl')
+ AssertLSPProject ale#test#GetFilename(b:files . '/app')
+
+ call ale#test#SetFilename(b:files . '/app/_build/default/lib/dep/src/dep.erl')
+ AssertLSPProject ale#test#GetFilename(b:files . '/app')
+
+Execute(Root of kerl managed Erlang/OTP installation should be detected):
+ call ale#test#SetFilename(b:files . '/kerl_otp_root/lib/stdlib-4.1.1/array.erl')
+ AssertLSPProject ale#test#GetFilename(b:files . '/kerl_otp_root')