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