diff options
Diffstat (limited to 'test')
4 files changed, 62 insertions, 2 deletions
diff --git a/test/command_callback/test_asm_gcc_command_callbacks.vader b/test/command_callback/test_asm_gcc_command_callbacks.vader new file mode 100644 index 00000000..ce8b906a --- /dev/null +++ b/test/command_callback/test_asm_gcc_command_callbacks.vader @@ -0,0 +1,39 @@ +Before: + Save g:ale_asm_gcc_executable + Save g:ale_asm_gcc_options + + unlet! g:ale_asm_gcc_executable + unlet! b:ale_asm_gcc_executable + unlet! g:ale_asm_gcc_options + unlet! b:ale_asm_gcc_options + + runtime ale_linters/asm/gcc.vim + + let b:command_tail = ' -x assembler -fsyntax-only -iquote' + \ . ' ' . ale#Escape(getcwd()) + \ . ' -Wall -' + +After: + Restore + unlet! b:command_tail + unlet! b:ale_asm_gcc_executable + unlet! b:ale_asm_gcc_options + call ale#linter#Reset() + +Execute(The executable should be configurable): + AssertEqual 'gcc', ale_linters#asm#gcc#GetExecutable(bufnr('')) + + let b:ale_asm_gcc_executable = 'foobar' + + AssertEqual 'foobar', ale_linters#asm#gcc#GetExecutable(bufnr('')) + +Execute(The executable should be used in the command): + AssertEqual + \ ale#Escape('gcc') . b:command_tail, + \ ale_linters#asm#gcc#GetCommand(bufnr('')) + + let b:ale_asm_gcc_executable = 'foobar' + + AssertEqual + \ ale#Escape('foobar') . b:command_tail, + \ ale_linters#asm#gcc#GetCommand(bufnr('')) diff --git a/test/command_callback/test_erb_command_callback.vader b/test/command_callback/test_erb_command_callback.vader index 2cfff7ed..9b1d223c 100644 --- a/test/command_callback/test_erb_command_callback.vader +++ b/test/command_callback/test_erb_command_callback.vader @@ -17,5 +17,5 @@ Execute(Executable should filter invalid eRuby when inside a Rails project): call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb') AssertEqual - \ 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . ' | ruby -c', + \ 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c', \ ale_linters#eruby#erb#GetCommand(bufnr('')) diff --git a/test/command_callback/test_erubis_command_callback.vader b/test/command_callback/test_erubis_command_callback.vader index 68624ec6..574dd684 100644 --- a/test/command_callback/test_erubis_command_callback.vader +++ b/test/command_callback/test_erubis_command_callback.vader @@ -17,5 +17,5 @@ Execute(Executable should filter invalid eRuby when inside a Rails project): call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/app/views/my_great_view.html.erb') AssertEqual - \ 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . ' | ruby -c', + \ 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . '< %t | ruby -c', \ ale_linters#eruby#erubis#GetCommand(bufnr('')) diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader index 6a84e571..725faff4 100644 --- a/test/test_highlight_placement.vader +++ b/test/test_highlight_placement.vader @@ -1,5 +1,6 @@ Before: Save g:ale_enabled + Save g:ale_set_signs function! GenerateResults(buffer, output) return [ @@ -258,3 +259,23 @@ Execute(Highlights should be cleared when ALE is disabled): call ale#highlight#UpdateHighlights() AssertEqual [], GetMatchesWithoutIDs() + +Execute(Line highlights should be set when signs are disabled): + let g:ale_set_signs = 0 + + call ale#highlight#SetHighlights(bufnr(''), [ + \ {'bufnr': bufnr(''), 'type': 'E', 'lnum': 1, 'col': 1}, + \ {'bufnr': bufnr(''), 'type': 'W', 'lnum': 2, 'col': 1}, + \ {'bufnr': bufnr(''), 'type': 'I', 'lnum': 3, 'col': 1}, + \]) + + AssertEqual + \ [ + \ {'group': 'ALEError', 'priority': 10, 'pos1': [1, 1, 1]}, + \ {'group': 'ALEWarning', 'priority': 10, 'pos1': [2, 1, 1]}, + \ {'group': 'ALEInfo', 'priority': 10, 'pos1': [3, 1, 1]}, + \ {'group': 'ALEErrorLine', 'priority': 10, 'pos1': [1]}, + \ {'group': 'ALEWarningLine', 'priority': 10, 'pos1': [2]}, + \ {'group': 'ALEInfoLine', 'priority': 10, 'pos1': [3]}, + \ ], + \ GetMatchesWithoutIDs() |