@@ -1500,6 +1500,30 @@ func testTabpage(v *Nvim) func(*testing.T) {
1500
1500
t .Fatalf ("expected valid but got %t" , valid )
1501
1501
}
1502
1502
})
1503
+
1504
+ t .Run ("TabpageVar" , func (t * testing.T ) {
1505
+ wantValue := []int {1 , 2 }
1506
+ if err := v .SetTabpageVar (Tabpage (0 ), "lua" , wantValue ); err != nil {
1507
+ t .Fatal (err )
1508
+ }
1509
+
1510
+ var gotValue []int
1511
+ if err := v .TabpageVar (Tabpage (0 ), "lua" , & gotValue ); err != nil {
1512
+ t .Fatal (err )
1513
+ }
1514
+
1515
+ if ! reflect .DeepEqual (gotValue , wantValue ) {
1516
+ t .Fatalf ("want %#v but got %#v" , wantValue , gotValue )
1517
+ }
1518
+
1519
+ if err := v .DeleteTabpageVar (Tabpage (0 ), "lua" ); err != nil {
1520
+ t .Fatal (err )
1521
+ }
1522
+
1523
+ if err := v .TabpageVar (Tabpage (0 ), "lua" , nil ); err == nil {
1524
+ t .Fatalf ("expect Key not found but fonud key" )
1525
+ }
1526
+ })
1503
1527
})
1504
1528
1505
1529
t .Run ("Batch" , func (t * testing.T ) {
@@ -1594,6 +1618,36 @@ func testTabpage(v *Nvim) func(*testing.T) {
1594
1618
t .Fatalf ("expected valid but got %t" , valid )
1595
1619
}
1596
1620
})
1621
+
1622
+ t .Run ("TabpageVar" , func (t * testing.T ) {
1623
+ b := v .NewBatch ()
1624
+
1625
+ wantValue := []int {1 , 2 }
1626
+ b .SetTabpageVar (Tabpage (0 ), "lua" , wantValue )
1627
+ if err := b .Execute (); err != nil {
1628
+ t .Fatal (err )
1629
+ }
1630
+
1631
+ var gotValue []int
1632
+ b .TabpageVar (Tabpage (0 ), "lua" , & gotValue )
1633
+ if err := b .Execute (); err != nil {
1634
+ t .Fatal (err )
1635
+ }
1636
+
1637
+ if ! reflect .DeepEqual (gotValue , wantValue ) {
1638
+ t .Fatalf ("want %#v but got %#v" , wantValue , gotValue )
1639
+ }
1640
+
1641
+ b .DeleteTabpageVar (Tabpage (0 ), "lua" )
1642
+ if err := b .Execute (); err != nil {
1643
+ t .Fatal (err )
1644
+ }
1645
+
1646
+ b .TabpageVar (Tabpage (0 ), "lua" , nil )
1647
+ if err := b .Execute (); err == nil {
1648
+ t .Fatalf ("expect Key not found but fonud key" )
1649
+ }
1650
+ })
1597
1651
})
1598
1652
}
1599
1653
}
0 commit comments