@@ -1076,6 +1076,28 @@ func testWindow(v *Nvim) func(*testing.T) {
1076
1076
t .Fatalf ("expect Key not found but fonud key" )
1077
1077
}
1078
1078
})
1079
+
1080
+ t .Run ("WindowOption" , func (t * testing.T ) {
1081
+ wantValue := "+1"
1082
+ if err := v .SetWindowOption (Window (0 ), "colorcolumn" , & wantValue ); err != nil {
1083
+ t .Fatal (err )
1084
+ }
1085
+
1086
+ var gotValue string
1087
+ if err := v .WindowOption (Window (0 ), "colorcolumn" , & gotValue ); err != nil {
1088
+ t .Fatal (err )
1089
+ }
1090
+
1091
+ if gotValue != wantValue {
1092
+ t .Fatalf ("expected %s but got %s" , wantValue , gotValue )
1093
+ }
1094
+
1095
+ t .Cleanup (func () {
1096
+ if err := v .SetWindowOption (Window (0 ), "colorcolumn" , "" ); err != nil {
1097
+ t .Fatal (err )
1098
+ }
1099
+ })
1100
+ })
1079
1101
})
1080
1102
1081
1103
t .Run ("Batch" , func (t * testing.T ) {
@@ -1264,6 +1286,33 @@ func testWindow(v *Nvim) func(*testing.T) {
1264
1286
t .Fatalf ("expect Key not found but fonud key" )
1265
1287
}
1266
1288
})
1289
+
1290
+ t .Run ("WindowOption" , func (t * testing.T ) {
1291
+ b := v .NewBatch ()
1292
+
1293
+ wantValue := "+1"
1294
+ b .SetWindowOption (Window (0 ), "colorcolumn" , & wantValue )
1295
+ if err := b .Execute (); err != nil {
1296
+ t .Fatal (err )
1297
+ }
1298
+
1299
+ var gotValue string
1300
+ b .WindowOption (Window (0 ), "colorcolumn" , & gotValue )
1301
+ if err := b .Execute (); err != nil {
1302
+ t .Fatal (err )
1303
+ }
1304
+
1305
+ if gotValue != wantValue {
1306
+ t .Fatalf ("expected %s but got %s" , wantValue , gotValue )
1307
+ }
1308
+
1309
+ t .Cleanup (func () {
1310
+ b .SetWindowOption (Window (0 ), "colorcolumn" , "" )
1311
+ if err := b .Execute (); err != nil {
1312
+ t .Fatal (err )
1313
+ }
1314
+ })
1315
+ })
1267
1316
})
1268
1317
}
1269
1318
}
0 commit comments