summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorMichał Budzyński <budziq@gmail.com>2018-06-04 11:08:49 +0200
committerMichał Budzyński <budziq@gmail.com>2018-06-04 11:08:49 +0200
commite2722071147a5a7feaadf7d574bc64f628402cdc (patch)
tree4a20be56fbc82248a5bcd2a96daa9ece4237f5fb /test/command_callback
parent4ec661b305bb168891624eb89466c1a2558fe63b (diff)
downloadale-e2722071147a5a7feaadf7d574bc64f628402cdc.zip
Allow linting rust tests and examples with cargo
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_cargo_command_callbacks.vader38
1 files changed, 37 insertions, 1 deletions
diff --git a/test/command_callback/test_cargo_command_callbacks.vader b/test/command_callback/test_cargo_command_callbacks.vader
index 9c06f27d..f674645f 100644
--- a/test/command_callback/test_cargo_command_callbacks.vader
+++ b/test/command_callback/test_cargo_command_callbacks.vader
@@ -1,11 +1,15 @@
Before:
Save g:ale_rust_cargo_use_check
Save g:ale_rust_cargo_check_all_targets
+ Save g:ale_rust_cargo_check_tests
+ Save g:ale_rust_cargo_check_examples
Save g:ale_rust_cargo_default_feature_behavior
Save g:ale_rust_cargo_include_features
unlet! g:ale_rust_cargo_use_check
- unlet! g:ale_cargo_check_all_targets
+ unlet! g:ale_rust_cargo_check_all_targets
+ unlet! g:ale_rust_cargo_check_tests
+ unlet! g:ale_rust_cargo_check_examples
unlet! g:ale_rust_cargo_default_feature_behavior
unlet! g:ale_rust_cargo_include_features
@@ -119,6 +123,38 @@ Execute(--all-targets should be used when g:ale_rust_cargo_check_all_targets is
AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
+Execute(--tests should be used when g:ale_rust_cargo_check_tests is set to 1):
+ let g:ale_rust_cargo_check_tests = 1
+
+ AssertEqual
+ \ 'cargo check --tests' . g:suffix,
+ \ ale_linters#rust#cargo#GetCommand(bufnr(''), [
+ \ 'cargo 0.22.0 (3423351a5 2017-10-06)',
+ \ ])
+
+ " We should cache the version check
+ AssertEqual
+ \ 'cargo check --tests' . g:suffix,
+ \ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
+
+ AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
+
+Execute(--examples should be used when g:ale_rust_cargo_check_examples is set to 1):
+ let g:ale_rust_cargo_check_examples = 1
+
+ AssertEqual
+ \ 'cargo check --examples' . g:suffix,
+ \ ale_linters#rust#cargo#GetCommand(bufnr(''), [
+ \ 'cargo 0.22.0 (3423351a5 2017-10-06)',
+ \ ])
+
+ " We should cache the version check
+ AssertEqual
+ \ 'cargo check --examples' . g:suffix,
+ \ ale_linters#rust#cargo#GetCommand(bufnr(''), [])
+
+ AssertEqual '', ale_linters#rust#cargo#VersionCheck(bufnr(''))
+
Execute(--no-default-features should be used when g:ale_rust_cargo_default_feature_behavior is none):
let g:ale_rust_cargo_default_feature_behavior = 'none'