summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-08-30 19:46:17 +0100
committerGitHub <noreply@github.com>2017-08-30 19:46:17 +0100
commitb8f5a4923c774e1e426d30d29834393c2636a653 (patch)
tree9fd69f2c9933766853c8481416efc3fa0cc22653 /test/handler
parentc7536fb4fdf76747dc3920cb21f39fd702477c90 (diff)
parentf4c5d29c64ccb1aa02a0d77ca84e52b0ef84eca0 (diff)
downloadale-b8f5a4923c774e1e426d30d29834393c2636a653.zip
Merge pull request #892 from jparise/thrift
Add a linter for Apache Thrift IDL files
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_thrift_handler.vader63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/handler/test_thrift_handler.vader b/test/handler/test_thrift_handler.vader
new file mode 100644
index 00000000..9bdb9378
--- /dev/null
+++ b/test/handler/test_thrift_handler.vader
@@ -0,0 +1,63 @@
+Before:
+ runtime ale_linters/thrift/thrift.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The thrift handler should handle basic warnings and errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 17,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
+ \ },
+ \ {
+ \ 'lnum': 20,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'Could not find include file include.thrift',
+ \ },
+ \ {
+ \ 'lnum': 83,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'Enum FOO is already defined!',
+ \ },
+ \ ],
+ \ ale_linters#thrift#thrift#Handle(1, [
+ \ '[WARNING:/path/filename.thrift:17] The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
+ \ '[WARNING:/path/filename.thrift:20] Could not find include file include.thrift',
+ \ '[FAILURE:/path/filename.thrift:83] Enum FOO is already defined!',
+ \ ])
+
+Execute(The thrift handler should handle multiline errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 75,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'This integer is too big: "11111111114213213453243"',
+ \ },
+ \ {
+ \ 'lnum': 76,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'Implicit field keys are deprecated and not allowed with -strict',
+ \ },
+ \ {
+ \ 'lnum': 77,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': "Unknown error (last token was ';')",
+ \ },
+ \ ],
+ \ ale_linters#thrift#thrift#Handle(1, [
+ \ "[ERROR:/path/filename.thrift:75] (last token was '11111111114213213453243')",
+ \ 'This integer is too big: "11111111114213213453243"',
+ \ "[ERROR:/path/filename.thrift:76] (last token was ';')",
+ \ 'Implicit field keys are deprecated and not allowed with -strict',
+ \ "[ERROR:/path/filename.thrift:77] (last token was ';')",
+ \ ])