diff options
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/test_cargo_command_callbacks.vader | 38 |
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' |