Skip to content

Commit 2becfba

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

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
@@ -1110,6 +1110,18 @@ func testWindow(v *Nvim) func(*testing.T) {
11101110
t.Fatalf("expected %v but got %v", wantPos, gotPos)
11111111
}
11121112
})
1113+
1114+
t.Run("WindowTabpage", func(t *testing.T) {
1115+
gotTabpage, err := v.WindowTabpage(Window(0))
1116+
if err != nil {
1117+
t.Fatal(err)
1118+
}
1119+
1120+
wantTabpage := Tabpage(1)
1121+
if gotTabpage != wantTabpage {
1122+
t.Fatalf("expected %v but got %v", wantTabpage, gotTabpage)
1123+
}
1124+
})
11131125
})
11141126

11151127
t.Run("Batch", func(t *testing.T) {
@@ -1340,6 +1352,21 @@ func testWindow(v *Nvim) func(*testing.T) {
13401352
t.Fatalf("expected %v but got %v", wantPos, gotPos)
13411353
}
13421354
})
1355+
1356+
t.Run("WindowTabpage", func(t *testing.T) {
1357+
b := v.NewBatch()
1358+
1359+
var gotTabpage Tabpage
1360+
b.WindowTabpage(Window(0), &gotTabpage)
1361+
if err := b.Execute(); err != nil {
1362+
t.Fatal(err)
1363+
}
1364+
1365+
wantTabpage := Tabpage(1)
1366+
if gotTabpage != wantTabpage {
1367+
t.Fatalf("expected %v but got %v", wantTabpage, gotTabpage)
1368+
}
1369+
})
13431370
})
13441371
}
13451372
}

0 commit comments

Comments
 (0)