Skip to content

Commit afc2c64

Browse files
committed
nvim: add SetWindowWidth and SetWindowHeight testcases
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 6182cba commit afc2c64

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

nvim/api_test.go

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,14 +2994,14 @@ func testFloatingWindow(v *Nvim) func(*testing.T) {
29942994
t.Fatal(err)
29952995
}
29962996

2997-
wantWidth := 40
2997+
wantWidth := 50
29982998
wantHeight := 20
29992999

30003000
cfg := &WindowConfig{
30013001
Relative: "cursor",
30023002
Anchor: "NW",
3003-
Width: wantWidth,
3004-
Height: wantHeight,
3003+
Width: 40,
3004+
Height: 10,
30053005
Row: 1,
30063006
Col: 0,
30073007
Focusable: true,
@@ -3015,6 +3015,14 @@ func testFloatingWindow(v *Nvim) func(*testing.T) {
30153015
t.Fatal("same window number: floating window not focused")
30163016
}
30173017

3018+
if err := v.SetWindowWidth(w, wantWidth); err != nil {
3019+
t.Fatal(err)
3020+
}
3021+
3022+
if err := v.SetWindowHeight(w, wantHeight); err != nil {
3023+
t.Fatal(err)
3024+
}
3025+
30183026
gotWidth, err := v.WindowWidth(w)
30193027
if err != nil {
30203028
t.Fatal(err)
@@ -3068,14 +3076,14 @@ func testFloatingWindow(v *Nvim) func(*testing.T) {
30683076
t.Fatal(err)
30693077
}
30703078

3071-
wantWidth := 40
3079+
wantWidth := 50
30723080
wantHeight := 20
30733081

30743082
cfg := &WindowConfig{
30753083
Relative: "cursor",
30763084
Anchor: "NW",
3077-
Width: wantWidth,
3078-
Height: wantHeight,
3085+
Width: 40,
3086+
Height: 10,
30793087
Row: 1,
30803088
Col: 0,
30813089
Focusable: true,
@@ -3091,6 +3099,12 @@ func testFloatingWindow(v *Nvim) func(*testing.T) {
30913099
t.Fatal("same window number: floating window not focused")
30923100
}
30933101

3102+
b.SetWindowWidth(w, wantWidth)
3103+
b.SetWindowHeight(w, wantHeight)
3104+
if err := b.Execute(); err != nil {
3105+
t.Fatal(err)
3106+
}
3107+
30943108
var gotWidth int
30953109
b.WindowWidth(w, &gotWidth)
30963110
var gotHeight int

0 commit comments

Comments
 (0)