Skip to content

Commit

Permalink
Merge pull request #3008 from bhcleek/highlight/reenable-test
Browse files Browse the repository at this point in the history
Revert "test: disable highlight tests"
  • Loading branch information
bhcleek authored Sep 7, 2020
2 parents 908dbae + fb59632 commit 9b9b527
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 73 deletions.
146 changes: 73 additions & 73 deletions autoload/go/highlight_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -270,79 +270,79 @@ function! s:numericHighlightGroupInSliceSlicing(testname, from, to)
endtry
endfunction

"function! Test_diagnostic_after_fmt() abort
" let g:go_fmt_command = 'gofmt'
" try
" call s:diagnostic_after_write( [
" \ 'package main',
" \ 'import "fmt"',
" \ '',
" \ 'func main() {',
" \ '',
" \ "\tfmt.Println(\x1fhello)",
" \ '}',
" \ ], [])
" finally
" unlet g:go_fmt_command
" endtry
"endfunction
"
"function! Test_diagnostic_after_fmt_change() abort
" " craft a file that will be changed when it is written (gofmt will change it).
" let g:go_fmt_command = 'gofmt'
" try
" call s:diagnostic_after_write( [
" \ 'package main',
" \ 'import "fmt"',
" \ '',
" \ 'func main() {',
" \ '',
" \ "fmt.Println(\x1fhello)",
" \ '}',
" \ ], [])
" finally
" unlet g:go_fmt_command
" endtry
"endfunction
"
"function! Test_diagnostic_after_fmt_cleared() abort
" " craft a file that will be fixed when it is written.
" let g:go_fmt_command = 'gofmt'
" try
" call s:diagnostic_after_write( [
" \ 'package main',
" \ 'import "fmt"',
" \ '',
" \ 'func main() {',
" \ '',
" \ "fmt.Println(\x1fhello)",
" \ '}',
" \ ], ['hello := "hello, vim-go"'])
" finally
" unlet g:go_fmt_command
" endtry
"endfunction
"
"function! Test_diagnostic_after_reload() abort
" let l:dir = gotest#write_file('diagnostic/after-reload.go', [
" \ 'package main',
" \ 'import "fmt"',
" \ '',
" \ 'func main() {',
" \ '',
" \ "\tfmt.Println(\x1fhello)",
" \ '}',
" \ ])
" try
" call s:check_diagnostics('', 'goDiagnosticError', 'initial')
" let l:pos = getcurpos()
" edit
" call setpos('.', l:pos)
" call s:check_diagnostics('', 'goDiagnosticError', 'after-reload')
" finally
" call delete(l:dir, 'rf')
" endtry
"endfunction
function! Test_diagnostic_after_fmt() abort
let g:go_fmt_command = 'gofmt'
try
call s:diagnostic_after_write( [
\ 'package main',
\ 'import "fmt"',
\ '',
\ 'func main() {',
\ '',
\ "\tfmt.Println(\x1fhello)",
\ '}',
\ ], [])
finally
unlet g:go_fmt_command
endtry
endfunction

function! Test_diagnostic_after_fmt_change() abort
" craft a file that will be changed when its written (gofmt will change it).
let g:go_fmt_command = 'gofmt'
try
call s:diagnostic_after_write( [
\ 'package main',
\ 'import "fmt"',
\ '',
\ 'func main() {',
\ '',
\ "fmt.Println(\x1fhello)",
\ '}',
\ ], [])
finally
unlet g:go_fmt_command
endtry
endfunction

function! Test_diagnostic_after_fmt_cleared() abort
" craft a file that will be fixed when it is written.
let g:go_fmt_command = 'gofmt'
try
call s:diagnostic_after_write( [
\ 'package main',
\ 'import "fmt"',
\ '',
\ 'func main() {',
\ '',
\ "fmt.Println(\x1fhello)",
\ '}',
\ ], ['hello := "hello, vim-go"'])
finally
unlet g:go_fmt_command
endtry
endfunction

function! Test_diagnostic_after_reload() abort
let l:dir = gotest#write_file('diagnostic/after-reload.go', [
\ 'package main',
\ 'import "fmt"',
\ '',
\ 'func main() {',
\ '',
\ "\tfmt.Println(\x1fhello)",
\ '}',
\ ])
try
call s:check_diagnostics('', 'goDiagnosticError', 'initial')
let l:pos = getcurpos()
edit
call setpos('.', l:pos)
call s:check_diagnostics('', 'goDiagnosticError', 'after-reload')
finally
call delete(l:dir, 'rf')
endtry
endfunction

function! s:diagnostic_after_write(contents, changes) abort
syntax on
Expand Down
1 change: 1 addition & 0 deletions scripts/runtest.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if !exists('g:test_verbose')
let g:test_verbose = 0
endif
let g:go_echo_command_info = 0
let g:go_gopls_options = []

function! s:logmessages() abort
" Add all messages (usually errors).
Expand Down

0 comments on commit 9b9b527

Please sign in to comment.