Skip to content

Commit 60a00ed

Browse files
committed
[release] src/testUtils.ts: fix parsing of the compiler error file expansion
Build error output format can be different from the test output format. Adjust the regex change in expandFilePathInOutput so it can capture build errors that contain column numbers as well while capturing the file path from test outputs such as ``` TestB: b_test.go:6: test failed ``` The above line was incorrectly expanded in pre v0.16.0 pre v0.16.0: /^\s*(.+.go):(\d+):/ v0.16.0, v0.16.1: /\s+(\S+.go):(\d+):\s+/ this CL: /\s*(\S+\.go):(\d+):/ Fixes #522 Change-Id: Ifa8f07d3bb7c5aaa61d40dd29d9fae77d8ad0cbe Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/248737 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> (cherry picked from commit 1e4dbe2) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/252118 TryBot-Result: kokoro <[email protected]>
1 parent 354ea27 commit 60a00ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export function cancelRunningTests(): Thenable<boolean> {
486486
function expandFilePathInOutput(output: string, cwd: string): string {
487487
const lines = output.split('\n');
488488
for (let i = 0; i < lines.length; i++) {
489-
const matches = lines[i].match(/\s+(\S+.go):(\d+):\s+/);
489+
const matches = lines[i].match(/\s*(\S+\.go):(\d+):/);
490490
if (matches && matches[1] && !path.isAbsolute(matches[1])) {
491491
lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));
492492
}

0 commit comments

Comments
 (0)