vim-patch:7.4.1954

Problem:    No test for what 7.4.1948 fixes.
Solution:   Add a test. (Hirohito Higashi, closes vim/vim#880)

d388d2ac8b

Some adjustments had to be made from upstream since nvim always uses
utf-8 internally.

* Removed the 'set encoding=cp932' line from the test
* Adjusted the expected values for getpos(), since the number of bytes
  is different in utf-8
This commit is contained in:
James McCoy 2017-02-10 09:29:27 -05:00
parent 91efe96b96
commit 3677189bfc
3 changed files with 31 additions and 1 deletions

View File

@ -37,6 +37,7 @@ NEW_TESTS = \
test_hardcopy.res \
test_help_tagjump.res \
test_history.res \
test_increment_dbcs.res \
test_langmap.res \
test_match.res \
test_matchadd_conceal.res \

View File

@ -0,0 +1,29 @@
" Tests for using Ctrl-A/Ctrl-X using DBCS.
if !has('multi_byte')
finish
endif
scriptencoding cp932
func SetUp()
new
set nrformats&
endfunc
func TearDown()
bwipe!
endfunc
func Test_increment_dbcs_1()
set nrformats+=alpha
call setline(1, ["ŽR1"])
exec "norm! 0\<C-A>"
call assert_equal(["ŽR2"], getline(1, '$'))
call assert_equal([0, 1, 4, 0], getpos('.'))
call setline(1, ["`ab0xDEe"])
exec "norm! 0\<C-X>"
call assert_equal(["`ab0xDDe"], getline(1, '$'))
call assert_equal([0, 1, 13, 0], getpos('.'))
endfunc
" vim: shiftwidth=2 expandtab

View File

@ -486,7 +486,7 @@ static int included_patches[] = {
// 1957 NA
1956,
// 1955 NA
// 1954,
1954,
1953,
1952,
// 1951 NA