From 733d187857e14e5f5c7627c0489dfcfea820208a Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 12 Sep 2024 22:54:31 -0400 Subject: [PATCH] use slices.ContainsFunc and better comment --- testjson/execution.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testjson/execution.go b/testjson/execution.go index 25d4be08..a8c99fb2 100644 --- a/testjson/execution.go +++ b/testjson/execution.go @@ -307,6 +307,10 @@ func rootTestPassed(p *Package, subtest TestCase) bool { continue } + // A TestCase name can exist more than once in an Execution due to + // the go test -count=n flag or when the input contains multiple separate + // test runs. + // Check the testcase has the correct ID for this subtest. for _, subID := range p.subTests[tc.ID] { if subID == subtest.ID { return true