vim-patch:7.4.1259

Problem:    No test for what patch 7.3.414 fixed.
Solution:   Add a test. (Elias Diem)

3fc3e14282
This commit is contained in:
KillTheMule 2016-04-12 19:50:53 +02:00
parent 0bfc1f33a0
commit 6ed201c5b5
2 changed files with 26 additions and 1 deletions

View File

@ -419,7 +419,7 @@ static int included_patches[] = {
// 1262 NA // 1262 NA
// 1261 NA // 1261 NA
// 1260 NA // 1260 NA
// 1259, 1259,
// 1258 NA // 1258 NA
// 1257 NA // 1257 NA
// 1256 NA // 1256 NA

View File

@ -708,6 +708,25 @@ describe('Ctrl-A/Ctrl-X on visual selections', function()
call assert_equal(["20"], getline(1, '$')) call assert_equal(["20"], getline(1, '$'))
call assert_equal([0, 1, 2, 0], getpos('.')) call assert_equal([0, 1, 2, 0], getpos('.'))
endfunc endfunc
" Test what patch 7.3.414 fixed. Ctrl-A on "000" drops the leading zeros.
func Test_normal_increment_01()
call setline(1, "000")
exec "norm! gg0\<C-A>"
call assert_equal("001", getline(1))
call setline(1, "000")
exec "norm! gg$\<C-A>"
call assert_equal("001", getline(1))
call setline(1, "001")
exec "norm! gg0\<C-A>"
call assert_equal("002", getline(1))
call setline(1, "001")
exec "norm! gg$\<C-A>"
call assert_equal("002", getline(1))
endfunc
]=]) ]=])
end) end)
@ -720,4 +739,10 @@ describe('Ctrl-A/Ctrl-X on visual selections', function()
eq({}, nvim.get_vvar('errors')) eq({}, nvim.get_vvar('errors'))
end) end)
end end
it('does not drop leading zeroes', function()
execute('set nrformats&vi') -- &vi makes Vim compatible
call('Test_normal_increment_01')
eq({}, nvim.get_vvar('errors'))
end)
end) end)