summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-26 21:17:47 +0100
committerw0rp <devw0rp@gmail.com>2017-10-26 21:21:42 +0100
commit33c2c20e66f694daf899963d778c47f824cda732 (patch)
tree41ce191eb81a8719f876bbc75dd6f286c311b3a3 /test
parent3ac92ea529e41fa733647692e40b6ee5c0622e1d (diff)
downloadale-33c2c20e66f694daf899963d778c47f824cda732.zip
Fix #1051 - Support ash and dash for shellcheck and the sh linter
Diffstat (limited to 'test')
-rw-r--r--test/test_shell_detection.vader20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_shell_detection.vader b/test/test_shell_detection.vader
index 37cf43ce..adb8d70d 100644
--- a/test/test_shell_detection.vader
+++ b/test/test_shell_detection.vader
@@ -81,3 +81,23 @@ Execute(The ksh dialect should be used for shellcheck if b:is_kornshell is 1):
let b:is_kornshell = 1
AssertEqual 'ksh', ale_linters#sh#shellcheck#GetDialectArgument(bufnr(''))
+
+Given(A file with /bin/ash):
+ #!/bin/ash
+
+Execute(The ash dialect should be used for the shell and the base function):
+ AssertEqual 'ash', ale#handlers#sh#GetShellType(bufnr(''))
+ AssertEqual 'ash', ale_linters#sh#shell#GetExecutable(bufnr(''))
+
+Execute(dash should be used for shellcheck, which has no ash dialect):
+ AssertEqual 'dash', ale_linters#sh#shellcheck#GetDialectArgument(bufnr(''))
+
+Given(A file with /bin/dash):
+ #!/bin/dash
+
+Execute(The dash dialect should be used for the shell and the base function):
+ AssertEqual 'dash', ale#handlers#sh#GetShellType(bufnr(''))
+ AssertEqual 'dash', ale_linters#sh#shell#GetExecutable(bufnr(''))
+
+Execute(dash should be used for shellcheck):
+ AssertEqual 'dash', ale_linters#sh#shellcheck#GetDialectArgument(bufnr(''))