@@ -484,15 +484,15 @@ func TestAPI(t *testing.T) {
484
484
})
485
485
486
486
t .Run ("virtual_text" , func (t * testing.T ) {
487
- clearBuffer (t , v , 0 ) // clear curret buffer text
487
+ clearBuffer (t , v , Buffer ( 0 ) ) // clear curret buffer text
488
488
489
489
nsID , err := v .CreateNamespace ("test_virtual_text" )
490
490
if err != nil {
491
491
t .Fatal (err )
492
492
}
493
493
494
494
lines := []byte ("ping" )
495
- if err := v .SetBufferLines (0 , 0 , - 1 , true , bytes .Fields (lines )); err != nil {
495
+ if err := v .SetBufferLines (Buffer ( 0 ) , 0 , - 1 , true , bytes .Fields (lines )); err != nil {
496
496
t .Fatal (err )
497
497
}
498
498
@@ -502,7 +502,7 @@ func TestAPI(t *testing.T) {
502
502
HLGroup : "String" ,
503
503
},
504
504
}
505
- nsID2 , err := v .SetBufferVirtualText (0 , nsID , 0 , chunks , make (map [string ]interface {}))
505
+ nsID2 , err := v .SetBufferVirtualText (Buffer ( 0 ) , nsID , 0 , chunks , make (map [string ]interface {}))
506
506
if err != nil {
507
507
t .Fatal (err )
508
508
}
@@ -511,7 +511,15 @@ func TestAPI(t *testing.T) {
511
511
t .Fatalf ("namespaceID: got %d, want %d" , got , nsID )
512
512
}
513
513
514
- if err := v .ClearBufferNamespace (0 , nsID , 0 , - 1 ); err != nil {
514
+ chunks2 , err := v .BufferVirtualText (Buffer (0 ), 0 )
515
+ if err != nil {
516
+ t .Fatal (err )
517
+ }
518
+ if ! reflect .DeepEqual (chunks , chunks2 ) {
519
+ t .Fatalf ("BufferVirtualText = %+v, want %+v" , chunks , chunks2 )
520
+ }
521
+
522
+ if err := v .ClearBufferNamespace (Buffer (0 ), nsID , 0 , - 1 ); err != nil {
515
523
t .Fatal (err )
516
524
}
517
525
})
0 commit comments