Skip to content

Commit 061b2e3

Browse files
committed
nvim: fix testcase for nightly
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 7c85d51 commit 061b2e3

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

nvim/api_test.go

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,6 +2819,11 @@ func testKey(v *Nvim) func(*testing.T) {
28192819
}
28202820
wantMapsLen = 2
28212821
}
2822+
if nvimVersion.Minor >= 7 {
2823+
wantMaps[0].RHS = "<Cmd>nohlsearch|diffupdate|normal! <C-L><CR>"
2824+
wantMaps[2].SID = -9
2825+
}
2826+
28222827
got, err := v.KeyMap(mode)
28232828
if err != nil {
28242829
t.Fatal(err)
@@ -2865,6 +2870,9 @@ func testKey(v *Nvim) func(*testing.T) {
28652870
NoWait: 0,
28662871
},
28672872
}
2873+
if nvimVersion.Minor >= 7 {
2874+
wantMap[0].SID = -9
2875+
}
28682876
got, err := v.BufferKeyMap(buffer, mode)
28692877
if err != nil {
28702878
t.Fatal(err)
@@ -3080,6 +3088,10 @@ func testKey(v *Nvim) func(*testing.T) {
30803088
}
30813089
wantMapsLen = 2
30823090
}
3091+
if nvimVersion.Minor >= 7 {
3092+
wantMaps[0].RHS = "<Cmd>nohlsearch|diffupdate|normal! <C-L><CR>"
3093+
wantMaps[2].SID = -9
3094+
}
30833095
var got []*Mapping
30843096
b.KeyMap(mode, &got)
30853097
if err := b.Execute(); err != nil {
@@ -3132,6 +3144,9 @@ func testKey(v *Nvim) func(*testing.T) {
31323144
NoWait: 0,
31333145
},
31343146
}
3147+
if nvimVersion.Minor >= 7 {
3148+
wantMap[0].SID = -9
3149+
}
31353150
var got []*Mapping
31363151
b.BufferKeyMap(buffer, mode, &got)
31373152
if err := b.Execute(); err != nil {
@@ -3364,7 +3379,7 @@ func testHighlight(v *Nvim) func(*testing.T) {
33643379
const HLIDName = `Error`
33653380
var wantErrorHLID = 64
33663381
if nvimVersion.Minor >= 7 {
3367-
wantErrorHLID = 66
3382+
wantErrorHLID = 67
33683383
}
33693384

33703385
goHLID, err := v.HLIDByName(HLIDName)
@@ -3503,7 +3518,7 @@ func testHighlight(v *Nvim) func(*testing.T) {
35033518
const HLIDName = `Error`
35043519
var wantErrorHLID = 64
35053520
if nvimVersion.Minor >= 7 {
3506-
wantErrorHLID = 66
3521+
wantErrorHLID = 67
35073522
}
35083523

35093524
var goHLID int
@@ -4301,7 +4316,10 @@ func testPutPaste(v *Nvim) func(*testing.T) {
43014316
if err != nil {
43024317
t.Fatal(err)
43034318
}
4304-
const want = "!foobarbaz!"
4319+
var want = "!foobarbaz!"
4320+
if nvimVersion.Minor >= 7 {
4321+
want = "!!foobarbaz"
4322+
}
43054323
if want != string(lines) {
43064324
t.Fatalf("got %s current lines but want %s", string(lines), want)
43074325
}
@@ -4329,7 +4347,10 @@ func testPutPaste(v *Nvim) func(*testing.T) {
43294347
if err := b.Execute(); err != nil {
43304348
t.Fatal(err)
43314349
}
4332-
const want = "!foobarbaz!"
4350+
var want = "!foobarbaz!"
4351+
if nvimVersion.Minor >= 7 {
4352+
want = "!!foobarbaz"
4353+
}
43334354
if want != string(lines) {
43344355
t.Fatalf("got %s current lines but want %s", string(lines), want)
43354356
}

0 commit comments

Comments
 (0)