Bram Moolenaar | 454709b | 2017-03-12 16:37:14 +0100 | [diff] [blame^] | 1 | " Tests for related f{char} and t{char} using utf-8. |
| 2 | if !has('multi_byte') |
| 3 | finish |
| 4 | endif |
| 5 | |
| 6 | " Test for t,f,F,T movement commands |
| 7 | function! Test_search_cmds() |
| 8 | new! |
| 9 | call setline(1, "・最初から最後まで最強のVimは最高") |
| 10 | 1 |
| 11 | normal! f最 |
| 12 | call assert_equal([0, 1, 4, 0], getpos('.')) |
| 13 | normal! ; |
| 14 | call assert_equal([0, 1, 16, 0], getpos('.')) |
| 15 | normal! 2; |
| 16 | call assert_equal([0, 1, 43, 0], getpos('.')) |
| 17 | normal! , |
| 18 | call assert_equal([0, 1, 28, 0], getpos('.')) |
| 19 | bw! |
| 20 | endfunction |
| 21 | |
| 22 | " vim: shiftwidth=2 sts=2 expandtab |
| 23 | " Tests for related f{char} and t{char} using utf-8. |
| 24 | if !has('multi_byte') |
| 25 | finish |
| 26 | endif |
| 27 | |
| 28 | " Test for t,f,F,T movement commands |
| 29 | function! Test_search_cmds() |
| 30 | new! |
| 31 | call setline(1, "・最初から最後まで最強のVimは最高") |
| 32 | 1 |
| 33 | normal! f最 |
| 34 | call assert_equal([0, 1, 4, 0], getpos('.')) |
| 35 | normal! ; |
| 36 | call assert_equal([0, 1, 16, 0], getpos('.')) |
| 37 | normal! 2; |
| 38 | call assert_equal([0, 1, 43, 0], getpos('.')) |
| 39 | normal! , |
| 40 | call assert_equal([0, 1, 28, 0], getpos('.')) |
| 41 | bw! |
| 42 | endfunction |
| 43 | |
| 44 | " vim: shiftwidth=2 sts=2 expandtab |