From d0c8fd615488608018bf0ced1f9f327e67804341 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Wed, 26 Aug 2020 13:06:16 +0200 Subject: [PATCH] Add missing t.Helper() I noticed over in cockroachdb/cockroach that test failures were printed as originating from `datadriven.go:194` as opposed to the actual test's invocation of `datadriven.RunTest`. Inserting the missing `t.Helper()` call seems to have fixed that. --- datadriven.go | 1 + 1 file changed, 1 insertion(+) diff --git a/datadriven.go b/datadriven.go index d45cb3f..9849b84 100644 --- a/datadriven.go +++ b/datadriven.go @@ -188,6 +188,7 @@ func runDirectiveOrSubTest( mandatorySubTestPrefix string, f func(*testing.T, *TestData) string, ) { + t.Helper() if subTestName, ok := isSubTestStart(t, r, mandatorySubTestPrefix); ok { runSubTest(subTestName, t, r, f) } else {