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