Bram Moolenaar | d388d2a | 2016-06-26 16:24:20 +0200 | [diff] [blame^] | 1 | " Tests for using Ctrl-A/Ctrl-X using DBCS. |
| 2 | if !has('multi_byte') |
| 3 | finish |
| 4 | endif |
| 5 | set encoding=cp932 |
| 6 | scriptencoding cp932 |
| 7 | |
| 8 | func SetUp() |
| 9 | new |
| 10 | set nrformats& |
| 11 | endfunc |
| 12 | |
| 13 | func TearDown() |
| 14 | bwipe! |
| 15 | endfunc |
| 16 | |
| 17 | func Test_increment_dbcs_1() |
| 18 | set nrformats+=alpha |
| 19 | call setline(1, ["R1"]) |
| 20 | exec "norm! 0\<C-A>" |
| 21 | call assert_equal(["R2"], getline(1, '$')) |
| 22 | call assert_equal([0, 1, 3, 0], getpos('.')) |
| 23 | |
| 24 | call setline(1, ["`ab0xDEe"]) |
| 25 | exec "norm! 0\<C-X>" |
| 26 | call assert_equal(["`ab0xDDe"], getline(1, '$')) |
| 27 | call assert_equal([0, 1, 10, 0], getpos('.')) |
| 28 | endfunc |
| 29 | |
| 30 | " vim: shiftwidth=2 expandtab |