test_charsearch_utf8.vim 781 B

123456789101112131415161718192021222324252627
  1. " Tests for related f{char} and t{char} using utf-8.
  2. " Test for t,f,F,T movement commands
  3. func Test_search_cmds()
  4. new!
  5. call setline(1, "・最初から最後まで最強のVimは最高")
  6. 1
  7. normal! f最
  8. call assert_equal([0, 1, 4, 0], getpos('.'))
  9. normal! ;
  10. call assert_equal([0, 1, 16, 0], getpos('.'))
  11. normal! 2;
  12. call assert_equal([0, 1, 43, 0], getpos('.'))
  13. normal! ,
  14. call assert_equal([0, 1, 28, 0], getpos('.'))
  15. call assert_equal('最', getcharsearch().char)
  16. call setcharsearch({'char' : ''})
  17. call assert_equal('', getcharsearch().char)
  18. call assert_beeps('normal ;')
  19. call assert_equal([0, 1, 28, 0], getpos('.'))
  20. call assert_beeps('normal ,')
  21. call assert_equal([0, 1, 28, 0], getpos('.'))
  22. bw!
  23. endfunc
  24. " vim: shiftwidth=2 sts=2 expandtab