From f747c961c4f2324474881fcbdc5d3be8dbba2ee3 Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Wed, 18 Oct 2017 15:30:21 -0700 Subject: [PATCH] fixup! improve test output handling --- autoload/go/test.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/autoload/go/test.vim b/autoload/go/test.vim index a147751219..c0e5636168 100644 --- a/autoload/go/test.vim +++ b/autoload/go/test.vim @@ -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