From 643c7cb3e249f1d7a167c70e7c574161e8102fc8 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Wed, 13 Sep 2023 13:02:07 -0500 Subject: [PATCH 1/2] test for no-column match --- __tests__/setup-go.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index 70f2166eb..0de001ff3 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -645,6 +645,16 @@ describe('setup-go', () => { expect(annotation.message).toBe('undefined: fmt.Printl'); }); + it('matches test output without a column', async () => { + const line = '/path/to/main_test.go:13: expected true but got false'; + const annotation = testMatch(line); + expect(annotation).toBeDefined(); + expect(annotation.line).toBe(13); + expect(annotation.column).toBe(NaN); + expect(annotation.file).toBe('/path/to/main_test.go'); + expect(annotation.message).toBe('expected true but got false'); + }); + // 1.13.1 => 1.13.1 // 1.13 => 1.13.0 // 1.10beta1 => 1.10.0-beta.1, 1.10rc1 => 1.10.0-rc.1 From 4dedda9ac2dd3fc90606b8d5283420b5ef54218e Mon Sep 17 00:00:00 2001 From: Will Roden Date: Wed, 13 Sep 2023 13:03:00 -0500 Subject: [PATCH 2/2] make column optional in matcher --- matchers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matchers.json b/matchers.json index 24be34118..ed0700942 100644 --- a/matchers.json +++ b/matchers.json @@ -4,7 +4,7 @@ "owner": "go", "pattern": [ { - "regexp": "^\\s*(.+\\.go):(?:(\\d+):(\\d+):)? (.*)", + "regexp": "^\\s*(.+\\.go):(?:(\\d+):(?:(\\d+):)?)? (.*)", "file": 1, "line": 2, "column": 3,