ale/test/handler/test_terraform_handler.vader

62 lines
1.7 KiB
Plaintext
Raw Normal View History

Before:
" Load the file which defines the linter.
runtime ale_linters/terraform/terraform.vim
call ale#test#SetDirectory('/testplugin/test/terraform_files')
call ale#test#SetFilename('providers.tf')
After:
" Unload all linters again.
call ale#linter#Reset()
call ale#test#RestoreDirectory()
Execute(The output should be correct):
AssertEqual
\ [
\ {
\ 'lnum': 17,
\ 'col': 13,
2021-01-30 09:17:28 +00:00
\ 'filename': ale#path#Simplify(g:dir . '/providers.tf'),
\ 'type': 'W',
\ 'text': 'Terraform 0.13 and earlier allowed provider version',
\ },
\ {
\ 'lnum': 0,
\ 'col': 0,
2021-01-30 09:17:28 +00:00
\ 'filename': ale#path#Simplify(g:dir . '/providers.tf'),
\ 'type': 'E',
\ 'text': 'Plugin reinitialization required. Please run "terraform"',
\ }
\ ],
\ ale_linters#terraform#terraform#Handle(bufnr(''), [
\ '{',
\ '"valid": false,',
\ '"error_count": 1,',
\ '"warning_count": 1,',
\ '"diagnostics": [',
\ ' {',
\ ' "severity": "warning",',
\ ' "summary": "Version constraints inside provider configuration blocks are deprecated",',
\ ' "detail": "Terraform 0.13 and earlier allowed provider version",',
\ ' "range": {',
\ ' "filename": "providers.tf",',
\ ' "start": {',
\ ' "line": 17,',
\ ' "column": 13,',
\ ' "byte": 669',
\ ' },',
\ ' "end": {',
\ ' "line": 17,',
\ ' "column": 24,',
\ ' "byte": 680',
\ ' }',
\ ' }',
\ ' },',
\ ' {',
\ ' "severity": "error",',
\ ' "summary": "Could not load plugin",',
\ ' "detail": "Plugin reinitialization required. Please run \"terraform\""',
\ ' }',
\ ' ]',
\ '}',
\ ])