test_increment_dbcs.vim 670 B

1234567891011121314151617181920212223242526272829303132
  1. " Tests for using Ctrl-A/Ctrl-X using DBCS.
  2. " neovim needs an iconv to handle cp932. Please do not remove the following
  3. " conditions.
  4. if !has('iconv')
  5. finish
  6. endif
  7. scriptencoding cp932
  8. func SetUp()
  9. new
  10. set nrformats&
  11. endfunc
  12. func TearDown()
  13. bwipe!
  14. endfunc
  15. func Test_increment_dbcs_1()
  16. set nrformats+=alpha
  17. call setline(1, ["ŽR1"])
  18. exec "norm! 0\<C-A>"
  19. call assert_equal(["ŽR2"], getline(1, '$'))
  20. call assert_equal([0, 1, 4, 0], getpos('.'))
  21. call setline(1, ["‚`‚a‚b0xDE‚e"])
  22. exec "norm! 0\<C-X>"
  23. call assert_equal(["‚`‚a‚b0xDD‚e"], getline(1, '$'))
  24. call assert_equal([0, 1, 13, 0], getpos('.'))
  25. endfunc
  26. " vim: shiftwidth=2 sts=2 expandtab