Skip to content

Commit 66dbd8c

Browse files
committed
nvim: support windows GOOS test
1 parent f262d38 commit 66dbd8c

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

nvim/nvim_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"path/filepath"
1111
"reflect"
12+
"runtime"
1213
"sort"
1314
"strings"
1415
"sync/atomic"
@@ -20,11 +21,15 @@ func newChildProcess(tb testing.TB) (v *Nvim, cleanup func()) {
2021
tb.Helper()
2122

2223
ctx := context.Background()
23-
n, err := NewChildProcess(
24+
opts := []ChildProcessOption{
2425
ChildProcessArgs("-u", "NONE", "-n", "--embed", "--headless", "--noplugin"),
2526
ChildProcessContext(ctx),
2627
ChildProcessLogf(tb.Logf),
27-
)
28+
}
29+
if runtime.GOOS == "windows" {
30+
opts = append(opts, ChildProcessCommand("nvim.exe"))
31+
}
32+
n, err := NewChildProcess(opts...)
2833
if err != nil {
2934
tb.Fatal(err)
3035
}
@@ -1554,6 +1559,10 @@ func clearBuffer(tb testing.TB, v *Nvim, buffer Buffer) {
15541559
}
15551560

15561561
func TestDial(t *testing.T) {
1562+
if runtime.GOOS == "windows" {
1563+
t.Skip("not supported dial unix socket on windows GOOS")
1564+
}
1565+
15571566
t.Parallel()
15581567

15591568
v1, cleanup := newChildProcess(t)

nvim/plugin/register_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package plugin_test
22

33
import (
44
"os"
5+
"runtime"
56
"strings"
67
"testing"
78

@@ -14,10 +15,16 @@ func newEmbeddedPlugin(t *testing.T) (*plugin.Plugin, func()) {
1415
if v := os.Getenv("VIM"); v != "" {
1516
env = append(env, "VIM="+v)
1617
}
17-
v, err := nvim.NewChildProcess(
18+
19+
opts := []nvim.ChildProcessOption{
1820
nvim.ChildProcessArgs("-u", "NONE", "-n", "--embed"),
1921
nvim.ChildProcessEnv(env),
20-
nvim.ChildProcessLogf(t.Logf))
22+
nvim.ChildProcessLogf(t.Logf),
23+
}
24+
if runtime.GOOS == "windows" {
25+
opts = append(opts, nvim.ChildProcessCommand("nvim.exe"))
26+
}
27+
v, err := nvim.NewChildProcess(opts...)
2128
if err != nil {
2229
t.Fatal(err)
2330
}

0 commit comments

Comments
 (0)