summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2020-08-17 23:37:23 +0100
committerGitHub <noreply@github.com>2020-08-17 23:37:23 +0100
commitbc6304bdb0361b3236222cf857427a924c9e2c4d (patch)
tree05eeb3779c913608850f58597480ded3a03d2f78 /test/handler
parentac56574b55a11a8a921bb5169dd4dd3a7348aeeb (diff)
parent2548763d04568823c4ef240f7f115adbb1dcfca2 (diff)
downloadale-bc6304bdb0361b3236222cf857427a924c9e2c4d.zip
Merge pull request #3007 from klaaspieter/swift-format
Add Apple's swift-format as a linter
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_swiftformat_handler.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/handler/test_swiftformat_handler.vader b/test/handler/test_swiftformat_handler.vader
new file mode 100644
index 00000000..3dcc4f1a
--- /dev/null
+++ b/test/handler/test_swiftformat_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime ale_linters/swift/swiftformat.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The swiftformat handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 21,
+ \ 'type': 'W',
+ \ 'code': 'DoNotUseSemicolons',
+ \ 'text': 'remove '';'' and move the next statement to the new line',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'type': 'W',
+ \ 'code': 'Spacing',
+ \ 'text': 'remove 1 space'
+ \ },
+ \ ],
+ \ ale_linters#swift#swiftformat#Handle(bufnr(''), [
+ \ 'Sources/main.swift:4:21: warning: [DoNotUseSemicolons]: remove '';'' and move the next statement to the new line',
+ \ 'Sources/main.swift:3:12: warning: [Spacing]: remove 1 space',
+ \ ])