mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:8.0.0111 (#7090)
Problem: The :history command is not tested.
Solution: Add tests. (Dominique Pelle)
eebd84eb94
This commit is contained in:

committed by
Justin M. Keyes

parent
120d1b80c9
commit
2753d61e4c
@@ -31,6 +31,30 @@ function History_Tests(hist)
|
||||
call assert_equal('ls', histget(a:hist, -1))
|
||||
call assert_equal(4, histnr(a:hist))
|
||||
|
||||
let a=execute('history ' . a:hist)
|
||||
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
|
||||
let a=execute('history all')
|
||||
call assert_match("^\n # .* history\n 3 buffers\n> 4 ls", a)
|
||||
|
||||
if len(a:hist) > 0
|
||||
let a=execute('history ' . a:hist . ' 2')
|
||||
call assert_match("^\n # \\S* history$", a)
|
||||
let a=execute('history ' . a:hist . ' 3')
|
||||
call assert_match("^\n # \\S* history\n 3 buffers$", a)
|
||||
let a=execute('history ' . a:hist . ' 4')
|
||||
call assert_match("^\n # \\S* history\n> 4 ls$", a)
|
||||
let a=execute('history ' . a:hist . ' 3,4')
|
||||
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
|
||||
let a=execute('history ' . a:hist . ' -1')
|
||||
call assert_match("^\n # \\S* history\n> 4 ls$", a)
|
||||
let a=execute('history ' . a:hist . ' -2')
|
||||
call assert_match("^\n # \\S* history\n 3 buffers$", a)
|
||||
let a=execute('history ' . a:hist . ' -2,')
|
||||
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
|
||||
let a=execute('history ' . a:hist . ' -3')
|
||||
call assert_match("^\n # \\S* history$", a)
|
||||
endif
|
||||
|
||||
" Test for removing entries matching a pattern
|
||||
for i in range(1, 3)
|
||||
call histadd(a:hist, 'text_' . i)
|
||||
|
@@ -841,7 +841,7 @@ static const int included_patches[] = {
|
||||
// 114 NA
|
||||
// 113 NA
|
||||
// 112,
|
||||
// 111,
|
||||
111,
|
||||
110,
|
||||
// 109 NA
|
||||
// 108 NA
|
||||
|
Reference in New Issue
Block a user