Skip to content

Commit 5f7616c

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

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
@@ -1122,6 +1122,18 @@ func testWindow(v *Nvim) func(*testing.T) {
11221122
t.Fatalf("expected %v but got %v", wantTabpage, gotTabpage)
11231123
}
11241124
})
1125+
1126+
t.Run("WindowNumber", func(t *testing.T) {
1127+
gotWinNum, err := v.WindowNumber(Window(0))
1128+
if err != nil {
1129+
t.Fatal(err)
1130+
}
1131+
1132+
wantWinNum := 1
1133+
if gotWinNum != wantWinNum {
1134+
t.Fatalf("expected %v but got %v", wantWinNum, gotWinNum)
1135+
}
1136+
})
11251137
})
11261138

11271139
t.Run("Batch", func(t *testing.T) {
@@ -1367,6 +1379,21 @@ func testWindow(v *Nvim) func(*testing.T) {
13671379
t.Fatalf("expected %v but got %v", wantTabpage, gotTabpage)
13681380
}
13691381
})
1382+
1383+
t.Run("WindowNumber", func(t *testing.T) {
1384+
b := v.NewBatch()
1385+
1386+
var gotWinNum int
1387+
b.WindowNumber(Window(0), &gotWinNum)
1388+
if err := b.Execute(); err != nil {
1389+
t.Fatal(err)
1390+
}
1391+
1392+
wantWinNum := 1
1393+
if gotWinNum != wantWinNum {
1394+
t.Fatalf("expected %v but got %v", wantWinNum, gotWinNum)
1395+
}
1396+
})
13701397
})
13711398
}
13721399
}

0 commit comments

Comments
 (0)