Skip to content

Commit 37da3c7

Browse files
committed
nvim: add TabpageWindow testcase
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 7b55653 commit 37da3c7

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
@@ -1454,6 +1454,18 @@ func testTabpage(v *Nvim) func(*testing.T) {
14541454
t.Fatal(err)
14551455
}
14561456

1457+
t.Run("TabpageWindow", func(t *testing.T) {
1458+
gotWin, err := v.TabpageWindow(Tabpage(0))
1459+
if err != nil {
1460+
t.Fatal(err)
1461+
}
1462+
1463+
wantWin := Window(1000)
1464+
if !reflect.DeepEqual(gotWin, wantWin) {
1465+
t.Fatalf("expected %v but got %v", wantWin, gotWin)
1466+
}
1467+
})
1468+
14571469
t.Run("TabpageWindows", func(t *testing.T) {
14581470
gotWins, err := v.TabpageWindows(Tabpage(0))
14591471
if err != nil {
@@ -1501,6 +1513,21 @@ func testTabpage(v *Nvim) func(*testing.T) {
15011513
t.Fatal(err)
15021514
}
15031515

1516+
t.Run("TabpageWindow", func(t *testing.T) {
1517+
b := v.NewBatch()
1518+
1519+
var gotWin Window
1520+
b.TabpageWindow(Tabpage(0), &gotWin)
1521+
if err := b.Execute(); err != nil {
1522+
t.Fatal(err)
1523+
}
1524+
1525+
wantWin := Window(1000)
1526+
if gotWin != wantWin {
1527+
t.Fatalf("expected %v but got %v", wantWin, gotWin)
1528+
}
1529+
})
1530+
15041531
t.Run("TabpageWindows", func(t *testing.T) {
15051532
b := v.NewBatch()
15061533

0 commit comments

Comments
 (0)