Skip to content

Commit 73ec9e6

Browse files
committed
chore(internal): add helper mark
1 parent 9bbc707 commit 73ec9e6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rules/internal/testutils/parse.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
//
4444
// It dedents the string before parsing.
4545
func ParseProtoStrings(t *testing.T, src map[string]string) map[string]protoreflect.FileDescriptor {
46+
t.Helper()
4647
filenames := []string{}
4748
for k, v := range src {
4849
filenames = append(filenames, k)
@@ -85,6 +86,7 @@ func ParseProtoStrings(t *testing.T, src map[string]string) map[string]protorefl
8586
// It adds the `syntax = "proto3";` line to the beginning of the file and
8687
// chooses a filename, and then calls ParseProtoStrings.
8788
func ParseProto3String(t *testing.T, src string) protoreflect.FileDescriptor {
89+
t.Helper()
8890
return ParseProtoStrings(t, map[string]string{
8991
"test.proto": fmt.Sprintf(
9092
"syntax = \"proto3\";\n\n%s",
@@ -98,6 +100,7 @@ func ParseProto3String(t *testing.T, src string) protoreflect.FileDescriptor {
98100
//
99101
// It dedents the string before parsing.
100102
func ParseProtoString(t *testing.T, src string) protoreflect.FileDescriptor {
103+
t.Helper()
101104
return ParseProtoStrings(t, map[string]string{"test.proto": src})["test.proto"]
102105
}
103106

@@ -107,6 +110,7 @@ func ParseProtoString(t *testing.T, src string) protoreflect.FileDescriptor {
107110
// It parses the template using Go's text/template Parse function, and then
108111
// calls ParseProto3String.
109112
func ParseProto3Tmpl(t *testing.T, src string, data interface{}) protoreflect.FileDescriptor {
113+
t.Helper()
110114
return ParseProto3Tmpls(t, map[string]string{
111115
"test.proto": src,
112116
}, data)["test.proto"]
@@ -118,6 +122,7 @@ func ParseProto3Tmpl(t *testing.T, src string, data interface{}) protoreflect.Fi
118122
// It parses the template using Go's text/template Parse function, and then
119123
// calls ParseProto3Strings.
120124
func ParseProto3Tmpls(t *testing.T, srcs map[string]string, data interface{}) map[string]protoreflect.FileDescriptor {
125+
t.Helper()
121126
strs := map[string]string{}
122127
for fn, src := range srcs {
123128
// Create a new template object.

0 commit comments

Comments
 (0)