Skip to content

Commit 19a1d6d

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

nvim/api_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,17 @@ func testWindow(v *Nvim) func(*testing.T) {
11341134
t.Fatalf("expected %v but got %v", wantWinNum, gotWinNum)
11351135
}
11361136
})
1137+
1138+
t.Run("IsWindowValid", func(t *testing.T) {
1139+
valid, err := v.IsWindowValid(Window(0))
1140+
if err != nil {
1141+
t.Fatal(err)
1142+
}
1143+
1144+
if !valid {
1145+
t.Fatalf("expected valid but got %t", valid)
1146+
}
1147+
})
11371148
})
11381149

11391150
t.Run("Batch", func(t *testing.T) {
@@ -1394,6 +1405,20 @@ func testWindow(v *Nvim) func(*testing.T) {
13941405
t.Fatalf("expected %v but got %v", wantWinNum, gotWinNum)
13951406
}
13961407
})
1408+
1409+
t.Run("IsWindowValid", func(t *testing.T) {
1410+
b := v.NewBatch()
1411+
1412+
var valid bool
1413+
b.IsWindowValid(Window(0), &valid)
1414+
if err := b.Execute(); err != nil {
1415+
t.Fatal(err)
1416+
}
1417+
1418+
if !valid {
1419+
t.Fatalf("expected valid but got %t", valid)
1420+
}
1421+
})
13971422
})
13981423
}
13991424
}

0 commit comments

Comments
 (0)