Skip to content

Commit a1bf4da

Browse files
committed
nvim: add Channels testcase
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 8dae6c2 commit a1bf4da

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

nvim/api_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4606,6 +4606,17 @@ func testChannelClientInfo(v *Nvim) func(*testing.T) {
46064606
)
46074607

46084608
t.Run("Nvim", func(t *testing.T) {
4609+
t.Run("Channels", func(t *testing.T) {
4610+
chans, err := v.Channels()
4611+
if err != nil {
4612+
t.Fatal(err)
4613+
}
4614+
4615+
if len(chans) == 0 {
4616+
t.Fatalf("want any channels but got %d", len(chans))
4617+
}
4618+
})
4619+
46094620
clientName := clientNamePrefix + "Nvim"
46104621

46114622
t.Run("SetClientInfo", func(t *testing.T) {
@@ -4640,6 +4651,19 @@ func testChannelClientInfo(v *Nvim) func(*testing.T) {
46404651

46414652
t.Run("Batch", func(t *testing.T) {
46424653
b := v.NewBatch()
4654+
4655+
t.Run("Channels", func(t *testing.T) {
4656+
var chans []*Channel
4657+
b.Channels(&chans)
4658+
if err := b.Execute(); err != nil {
4659+
t.Fatal(err)
4660+
}
4661+
4662+
if len(chans) == 0 {
4663+
t.Fatalf("want any channels but got %d", len(chans))
4664+
}
4665+
})
4666+
46434667
clientName := clientNamePrefix + "Batch"
46444668

46454669
t.Run("SetClientInfo", func(t *testing.T) {

0 commit comments

Comments
 (0)