Skip to content

Commit

Permalink
fixup! improve test output handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Oct 30, 2017
1 parent 80c81dd commit f747c96
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions autoload/go/test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,29 @@ function! s:parse_errors(lines) abort

let tokens = []
if paniced
" Matches lines in stacktraces produced by panic. The lines always have
" one ore more leading tabs, followed by the path to the file. The file
" path is followed by a colon and then the line number within the file
" where the panic occurred. After that there's a space and hexadecimal
" number.
"
" e.g.:
" '\t/usr/local/go/src/time.go:1313 +0x5d'
let tokens = matchlist(line, '^\t\+\(.\{-}\.go\):\(\d\+\) \(+0x.*\)')
else
" matches lines produced by `go test`. All lines produced by `go test`
" that we're interested in start with zero or more spaces (increasing
" depth of subtests is represented by a similar increase in the number
" of spaces at the start of output lines. Top level tests start with
" zero leading spaces). Lines that indicate test status (e.g. RUN, FAIL,
" PASS) start after the spaces. Lines that indicate test failure
" location or test log message location (e.g. "testing.T".Log) begin
" with the appropriate number of spaces for the current test level,
" followed by a tab, a filename , a colon, the line number, another
" colon, a space, and the failure or log message.
"
" e.g.:
" '\ttime_test.go:30: Likely problem: the time zone files have not been installed.'
let tokens = matchlist(line, '^ *\t\+\(.\{-}\.go\):\(\d\+\):\s*\(.*\)')
endif

Expand Down

0 comments on commit f747c96

Please sign in to comment.