summaryrefslogtreecommitdiff
path: root/test/test_shell_detection.vader
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2020-08-17 21:29:16 +0100
committerGitHub <noreply@github.com>2020-08-17 21:29:16 +0100
commiteb864730e2bf843f83dcf58ae43c802ad0cad8ee (patch)
tree2fb99823bad74b288ce3f5868a871490c0d4cb3b /test/test_shell_detection.vader
parent514e5a8baa539f38c62881673727be6f67935d75 (diff)
parentece229c06f36efdc172ae6d70c73b72a16bb4cdf (diff)
downloadale-eb864730e2bf843f83dcf58ae43c802ad0cad8ee.zip
Merge pull request #2906 from elebow/shelldetect-fall-back-to-filetype-if-no-hashbang
ShellDetect falls back to filetype if no hashbang (fixes #2886)
Diffstat (limited to 'test/test_shell_detection.vader')
-rw-r--r--test/test_shell_detection.vader10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_shell_detection.vader b/test/test_shell_detection.vader
index 6452287f..697054d0 100644
--- a/test/test_shell_detection.vader
+++ b/test/test_shell_detection.vader
@@ -98,6 +98,16 @@ Execute(The ksh dialect should be used for shellcheck if b:is_kornshell is 1):
AssertEqual 'ksh', ale#handlers#shellcheck#GetDialectArgument(bufnr(''))
+Execute(The filetype should be used as the default shell type when there is no hashbang line):
+ set filetype=zsh
+ AssertEqual 'zsh', ale#handlers#sh#GetShellType(bufnr(''))
+
+ set filetype=tcsh
+ AssertEqual 'tcsh', ale#handlers#sh#GetShellType(bufnr(''))
+
+ set filetype=python
+ AssertEqual '', ale#handlers#sh#GetShellType(bufnr(''))
+
Given(A file with /bin/ash):
#!/bin/ash