Skip to content

Commit 993904c

Browse files
committed
Improve naming
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 686c2b7 commit 993904c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pty/ptytest/ptytest.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ type outExpecter struct {
146146
}
147147

148148
func (e *outExpecter) ExpectMatch(str string) string {
149-
return e.expectMatchContext(str, e.ExpectMatchContext)
149+
return e.expectMatchContextFunc(str, e.ExpectMatchContext)
150150
}
151151

152152
func (e *outExpecter) ExpectRegexMatch(str string) string {
153-
return e.expectMatchContext(str, e.ExpectRegexMatchContext)
153+
return e.expectMatchContextFunc(str, e.ExpectRegexMatchContext)
154154
}
155155

156-
func (e *outExpecter) expectMatchContext(str string, impl func(ctx context.Context, str string) string) string {
156+
func (e *outExpecter) expectMatchContextFunc(str string, impl func(ctx context.Context, str string) string) string {
157157
e.t.Helper()
158158

159159
timeout, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
@@ -164,18 +164,18 @@ func (e *outExpecter) expectMatchContext(str string, impl func(ctx context.Conte
164164

165165
// TODO(mafredri): Rename this to ExpectMatch when refactoring.
166166
func (e *outExpecter) ExpectMatchContext(ctx context.Context, str string) string {
167-
return e.expectMatcher(ctx, str, func(src, pattern string) bool {
167+
return e.expectMatcherFunc(ctx, str, func(src, pattern string) bool {
168168
return strings.Contains(src, pattern)
169169
})
170170
}
171171

172172
func (e *outExpecter) ExpectRegexMatchContext(ctx context.Context, str string) string {
173-
return e.expectMatcher(ctx, str, func(src, pattern string) bool {
173+
return e.expectMatcherFunc(ctx, str, func(src, pattern string) bool {
174174
return regexp.MustCompile(pattern).MatchString(src)
175175
})
176176
}
177177

178-
func (e *outExpecter) expectMatcher(ctx context.Context, str string, matchFn func(src, pattern string) bool) string {
178+
func (e *outExpecter) expectMatcherFunc(ctx context.Context, str string, matchFn func(src, pattern string) bool) string {
179179
e.t.Helper()
180180

181181
var buffer bytes.Buffer

0 commit comments

Comments
 (0)