Skip to content

Commit 346ffdc

Browse files
committed
nvim: add AddBufferHighlight testcase
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 72e428e commit 346ffdc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nvim/api_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,6 +3261,14 @@ func testHighlight(v *Nvim) func(*testing.T) {
32613261
if wantRedColor != gotColor {
32623262
t.Fatalf("expected red color %d but got %d", wantRedColor, gotColor)
32633263
}
3264+
3265+
id, err := v.AddBufferHighlight(Buffer(0), 0, `NewHighlight2`, 0, 0, -1)
3266+
if err != nil {
3267+
t.Fatal(err)
3268+
}
3269+
if id < 0 {
3270+
t.Fatalf("want id is not negative but got %d", id)
3271+
}
32643272
})
32653273

32663274
t.Run("Batch", func(t *testing.T) {
@@ -3394,6 +3402,16 @@ func testHighlight(v *Nvim) func(*testing.T) {
33943402
if wantRedColor != gotColor {
33953403
t.Fatalf("expected red color %d but got %d", wantRedColor, gotColor)
33963404
}
3405+
3406+
var id int
3407+
b.AddBufferHighlight(Buffer(0), 0, `NewHighlight2`, 0, 0, -1, &id)
3408+
if err := b.Execute(); err != nil {
3409+
t.Fatal(err)
3410+
}
3411+
3412+
if id < 0 {
3413+
t.Fatalf("want id is not negative but got %d", id)
3414+
}
33973415
})
33983416
}
33993417
}

0 commit comments

Comments
 (0)