@@ -152,12 +152,12 @@ function! s:errorformat() abort
152
152
" each level of test indents the test output 4 spaces. Capturing groups
153
153
" (e.g. \(\)) cannot be used in an errorformat, but non-capturing groups can
154
154
" (e.g. \%(\)).
155
- let indent = ' %\\%( %\\)%# '
155
+ let indent = ' %\\%( %\\)'
156
156
157
157
" ignore `go test -v` output for starting tests
158
158
let format = " %-G=== RUN %.%#"
159
159
" ignore `go test -v` output for passing tests
160
- let format .= " ,%-G" . indent . " --- PASS: %.%#"
160
+ let format .= " ,%-G" . indent . " %# --- PASS: %.%#"
161
161
162
162
" Match failure lines.
163
163
"
@@ -167,24 +167,25 @@ function! s:errorformat() abort
167
167
" e.g.:
168
168
" '--- FAIL: TestSomething (0.00s)'
169
169
if show_name
170
- let format .= " ,%G" . indent . " --- FAIL: %m (%.%#)"
170
+ let format .= " ,%G" . indent . " %# --- FAIL: %m (%.%#)"
171
171
else
172
- let format .= " ,%-G" . indent . " --- FAIL: %.%#"
172
+ let format .= " ,%-G" . indent . " %# --- FAIL: %.%#"
173
173
endif
174
174
175
+ " Go 1.10 test output {{{1
175
176
" Matches test output lines.
176
177
"
177
178
" All test output lines start with the test indentation and a tab, followed
178
179
" by the filename, a colon, the line number, another colon, a space, and the
179
180
" message. e.g.:
180
181
" '\ttime_test.go:30: Likely problem: the time zone files have not been installed.'
181
- let format .= " ,%A" . indent . " %\\ t%\\ +%f:%l: %m"
182
+ let format .= " ,%A" . indent . " %#% \\ t%\\ +%f:%l: %m"
182
183
" also match lines that don't have a message (i.e. the message begins with a
183
184
" newline or is the empty string):
184
185
" e.g.:
185
186
" t.Errorf("\ngot %v; want %v", actual, expected)
186
187
" t.Error("")
187
- let format .= " ,%A" . indent . " %\\ t%\\ +%f:%l: "
188
+ let format .= " ,%A" . indent . " %#% \\ t%\\ +%f:%l: "
188
189
189
190
" Match the 2nd and later lines of multi-line output. These lines are
190
191
" indented the number of spaces for the level of nesting of the test,
@@ -197,7 +198,17 @@ function! s:errorformat() abort
197
198
" indicate that they're multiple lines of output, but in that case the lines
198
199
" get concatenated in the quickfix list, which is not what users typically
199
200
" want when writing a newline into their test output.
200
- let format .= " ,%G" . indent . " %\\ t%\\ {2}%m"
201
+ let format .= " ,%G" . indent . " %#%\\ t%\\ {2}%m"
202
+ " }}}1
203
+
204
+ " Go 1.11 test output {{{1
205
+ " Match test output lines similarly to Go 1.10 test output lines, but they
206
+ " use an indent level where the Go 1.10 test output uses tabs, so they'll
207
+ " always have at least one level indentation...
208
+ let format .= " ,%A" . indent . " %\\ +%f:%l: %m"
209
+ let format .= " ,%A" . indent . " %\\ +%f:%l: "
210
+ let format .= " ,%G" . indent . " %\\ {2\\ ,}%m"
211
+ " }}}1
201
212
202
213
" set the format for panics.
203
214
@@ -261,16 +272,16 @@ function! s:errorformat() abort
261
272
let format .= " ,%-Cexit status %[0-9]%\\ +"
262
273
" let format .= ",exit status %[0-9]%\\+"
263
274
264
- " Match and ignore exit failure lines whether part of a multi-line message
275
+ " Match and ignore failure lines whether part of a multi-line message
265
276
" or not, because these lines sometimes come before and sometimes after
266
277
" panic stacktraces.
267
278
let format .= " ,%-CFAIL%\\ t%.%#"
268
279
" let format .= ",FAIL%\\t%.%#"
269
280
270
- " match compiler errors
271
- " These are very smilar to errors from test output, but lack leading tabs
272
- " for the first line of an error, and subsequent lines only have one tab
273
- " instead of two.
281
+ " match compiler errors.
282
+ " These are very smilar to errors from <=go1.10 test output, but lack
283
+ " leading tabs for the first line of an error, and subsequent lines only
284
+ " have one tab instead of two.
274
285
let format .= " ,%A%f:%l:%c: %m"
275
286
let format .= " ,%A%f:%l: %m"
276
287
" It would be nice if this weren't necessary, but panic lines from tests are
0 commit comments