diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-18 23:57:33 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-18 23:57:33 +0100 |
commit | 235fc90e226ccc0430b9faa0cd3a226d9be6f31c (patch) | |
tree | 173aa89218f03254c5ccb6e80a5ee6139bd21132 /test/command_callback/test_dartanalyzer_command_callback.vader | |
parent | aa94d0902a557bc8d65b51a868cf1e122edd2306 (diff) | |
download | ale-235fc90e226ccc0430b9faa0cd3a226d9be6f31c.zip |
Fix #308 - Check Dart files with dartanalyzer
Diffstat (limited to 'test/command_callback/test_dartanalyzer_command_callback.vader')
-rw-r--r-- | test/command_callback/test_dartanalyzer_command_callback.vader | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/command_callback/test_dartanalyzer_command_callback.vader b/test/command_callback/test_dartanalyzer_command_callback.vader new file mode 100644 index 00000000..c26028de --- /dev/null +++ b/test/command_callback/test_dartanalyzer_command_callback.vader @@ -0,0 +1,40 @@ +Before: + Save g:ale_dart_dartanalyzer_executable + unlet! g:ale_dart_dartanalyzer_executable + + runtime ale_linters/dart/dartanalyzer.vim + + call ale#test#SetDirectory('/testplugin/test/command_callback') + +After: + Restore + + call ale#test#RestoreDirectory() + call ale#linter#Reset() + +Execute(The default command and executable should be correct): + AssertEqual + \ 'dartanalyzer', + \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr('')) + AssertEqual + \ ale#Escape('dartanalyzer') . ' %t', + \ ale_linters#dart#dartanalyzer#GetCommand(bufnr('')) + +Execute(The executable should be configurable): + let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer' + + AssertEqual + \ '/usr/lib/dart/bin/dartanalyzer', + \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr('')) + AssertEqual + \ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %t', + \ ale_linters#dart#dartanalyzer#GetCommand(bufnr('')) + +Execute(The .packages file should be set if detected): + call ale#test#SetFilename('dart_paths/foo') + + AssertEqual + \ ale#Escape('dartanalyzer') + \ . ' --packages ' . ale#Escape(g:dir . '/dart_paths/.packages') + \ . ' %t', + \ ale_linters#dart#dartanalyzer#GetCommand(bufnr('')) |