Skip to content

Commit dc9e1dc

Browse files
committed
nvim: change newChildProcess and clearBuffer arg to testing.TB
1 parent 9b8bd51 commit dc9e1dc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

nvim/nvim_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ import (
1414
"time"
1515
)
1616

17-
func newChildProcess(t *testing.T) (*Nvim, func()) {
17+
func newChildProcess(tb testing.TB) (*Nvim, func()) {
18+
tb.Helper()
19+
1820
v, err := NewChildProcess(
1921
ChildProcessArgs("-u", "NONE", "-n", "--embed", "--headless"),
2022
ChildProcessEnv([]string{}),
21-
ChildProcessLogf(t.Logf))
23+
ChildProcessLogf(tb.Logf))
2224
if err != nil {
23-
t.Fatal(err)
25+
tb.Fatal(err)
2426
}
2527

2628
done := make(chan error, 1)
@@ -30,7 +32,7 @@ func newChildProcess(t *testing.T) (*Nvim, func()) {
3032

3133
return v, func() {
3234
if err := v.Close(); err != nil {
33-
t.Fatal(err)
35+
tb.Fatal(err)
3436
}
3537
}
3638
}
@@ -754,9 +756,11 @@ func testRuntimeFiles(t *testing.T, v *Nvim) func(*testing.T) {
754756
}
755757

756758
// clearBuffer clears the buffer text.
757-
func clearBuffer(t *testing.T, v *Nvim, buffer Buffer) {
759+
func clearBuffer(tb testing.TB, v *Nvim, buffer Buffer) {
760+
tb.Helper()
761+
758762
if err := v.SetBufferLines(buffer, 0, -1, true, bytes.Fields(nil)); err != nil {
759-
t.Fatal(err)
763+
tb.Fatal(err)
760764
}
761765
}
762766

0 commit comments

Comments
 (0)