summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_systemd_analyze_command_callback.vader9
-rw-r--r--test/handler/test_systemd_analyze_hander.vader19
2 files changed, 28 insertions, 0 deletions
diff --git a/test/command_callback/test_systemd_analyze_command_callback.vader b/test/command_callback/test_systemd_analyze_command_callback.vader
new file mode 100644
index 00000000..d97c87be
--- /dev/null
+++ b/test/command_callback/test_systemd_analyze_command_callback.vader
@@ -0,0 +1,9 @@
+Before:
+ call ale#assert#SetUpLinterTest('systemd', 'systemd_analyze')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default command should be correct):
+ AssertLinter 'systemd-analyze',
+ \ 'SYSTEMD_LOG_COLOR=0 ' . ale#Escape('systemd-analyze') . ' --user verify %s'
diff --git a/test/handler/test_systemd_analyze_hander.vader b/test/handler/test_systemd_analyze_hander.vader
new file mode 100644
index 00000000..c7d668e0
--- /dev/null
+++ b/test/handler/test_systemd_analyze_hander.vader
@@ -0,0 +1,19 @@
+Before:
+ runtime ale_linters/systemd/systemd_analyze.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The systemd-analyze handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 9,
+ \ 'col': 1,
+ \ 'type': 'W',
+ \ 'text': 'Unknown key name ''Wat'' in section ''Service'', ignoring.',
+ \ },
+ \ ],
+ \ ale_linters#systemd#systemd_analyze#Handle(bufnr(''), [
+ \ '/home/user/.config/systemd/user/foo.service:9: Unknown key name ''Wat'' in section ''Service'', ignoring.',
+ \ ])