Skip to content

Commit 3e51089

Browse files
committed
nvim: add WindowPosition testcase
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 49db01d commit 3e51089

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

nvim/api_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,18 @@ func testWindow(v *Nvim) func(*testing.T) {
10981098
}
10991099
})
11001100
})
1101+
1102+
t.Run("WindowPosition", func(t *testing.T) {
1103+
gotPos, err := v.WindowPosition(Window(0))
1104+
if err != nil {
1105+
t.Fatal(err)
1106+
}
1107+
1108+
wantPos := [2]int{0, 0}
1109+
if gotPos != wantPos {
1110+
t.Fatalf("expected %v but got %v", wantPos, gotPos)
1111+
}
1112+
})
11011113
})
11021114

11031115
t.Run("Batch", func(t *testing.T) {
@@ -1313,6 +1325,21 @@ func testWindow(v *Nvim) func(*testing.T) {
13131325
}
13141326
})
13151327
})
1328+
1329+
t.Run("WindowPosition", func(t *testing.T) {
1330+
b := v.NewBatch()
1331+
1332+
var gotPos [2]int
1333+
b.WindowPosition(Window(0), &gotPos)
1334+
if err := b.Execute(); err != nil {
1335+
t.Fatal(err)
1336+
}
1337+
1338+
wantPos := [2]int{0, 0}
1339+
if gotPos != wantPos {
1340+
t.Fatalf("expected %v but got %v", wantPos, gotPos)
1341+
}
1342+
})
13161343
})
13171344
}
13181345
}

0 commit comments

Comments
 (0)