All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('vhdl', 'hdl_checker')
4 Save g:ale_hdl_checker_executable
5 Save g:ale_hdl_checker_config_file
6 Save g:ale_hdl_checker_options
8 let g:default_config_file = has('unix') ? '.hdl_checker.config' : '_hdl_checker.config'
10 runtime autoload/ale/handlers/hdl_checker.vim
15 call ale#assert#TearDownLinterTest()
17 unlet! g:default_config_file
20 runtime autoload/ale/handlers/hdl_checker.vim
22 Execute(Get default initialization dict):
24 \ {'project_file': g:default_config_file},
25 \ ale#handlers#hdl_checker#GetInitOptions(bufnr(''))
27 Execute(Get custom initialization dict):
28 let g:ale_hdl_checker_config_file = 'some_file_name'
31 \ {'project_file': 'some_file_name'},
32 \ ale#handlers#hdl_checker#GetInitOptions(bufnr(''))
34 Execute(Get the checker command without extra user parameters):
36 \ ale#Escape('hdl_checker') . ' --lsp',
37 \ ale#handlers#hdl_checker#GetCommand(bufnr(''))
39 Execute(Get the checker command with user configured parameters):
40 let g:ale_hdl_checker_options = '--log-level DEBUG'
43 \ ale#Escape('hdl_checker') . ' --lsp --log-level DEBUG',
44 \ ale#handlers#hdl_checker#GetCommand(bufnr(''))
46 Execute(Customize executable):
47 let g:ale_hdl_checker_executable = '/some/other/path'
49 \ ale#Escape('/some/other/path') . ' --lsp',
50 \ ale#handlers#hdl_checker#GetCommand(bufnr(''))
52 Execute(Get project root based on .git):
53 call ale#test#SetFilename('../test-files/hdl_server/with_git/files/foo.vhd')
55 silent! call mkdir(g:dir . '/../test-files/hdl_server/with_git/.git')
56 AssertNotEqual '', glob(g:dir . '/../test-files/hdl_server/with_git/.git')
59 \ ale#path#Simplify(g:dir . '/../test-files/hdl_server/with_git'),
60 \ ale#handlers#hdl_checker#GetProjectRoot(bufnr(''))
62 Execute(Get project root based on config file):
63 call ale#test#SetFilename('../test-files/hdl_server/with_config_file/foo.vhd')
66 \ ale#path#Simplify(g:dir . '/../test-files/hdl_server/with_config_file'),
67 \ ale#handlers#hdl_checker#GetProjectRoot(bufnr(''))
69 Execute(Return no project root if neither .git or config file are found):
72 " Mock this command to avoid the test to find ale's own .git folder
73 function! ale#handlers#hdl_checker#IsDotGit(path) abort
78 call ale#test#SetFilename('../test-files/hdl_server/foo.vhd')
82 \ ale#handlers#hdl_checker#GetProjectRoot(bufnr(''))
84 AssertEqual g:call_count, 1