zstar.vimspec 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. scriptencoding utf-8
  2. Describe zstar
  3. Before all
  4. let lines = [
  5. \ '1.asterisk 2.asterisk 3.asterisk'
  6. \ , '4.Asterisk 5.AsteRisK 6.Asterisk'
  7. \ , ''
  8. \ , '7.アスタリスク 8.アスタリスクです 9.アスタリスク?'
  9. \ ]
  10. call g:Add_lines(lines)
  11. End
  12. Before each
  13. call cursor([1, 1])
  14. normal! 2l
  15. let @/ = ''
  16. End
  17. After all
  18. :1,$ delete
  19. End
  20. Context z*
  21. It set search registar with \<\>
  22. normal z*
  23. Assert Equals(@/, '\<asterisk\>')
  24. End
  25. It add search history with \<\>
  26. call histadd('/', ' ')
  27. Assert Equals(histget('/', -1), ' ')
  28. normal z*
  29. Assert Equals(histget('/', -1), '\<asterisk\>')
  30. End
  31. It set v:searchforward to 1
  32. let v:searchforward = 0
  33. normal z*
  34. Assert Equals(v:searchforward, 1)
  35. End
  36. It doesn't move cursor
  37. Assert Equals(g:Get_pos_char(), 'a')
  38. normal z*
  39. Assert Equals(g:Get_pos_char(), 'a')
  40. normal! 2h
  41. Assert Equals(g:Get_pos_char(), '1')
  42. End
  43. It handle 'selection' value
  44. :1,$ delete
  45. call g:Add_lines(['NeoBundle "kannokanno/previm"'])
  46. let save = &selection
  47. for v in ['inclusive', 'old', 'exclusive']
  48. call cursor([1, 1])
  49. Assert Equals(g:Get_pos_char(), 'N')
  50. let &selection=v
  51. normal ve6ho*
  52. Assert Equals(histget('/', -1), '\V\<Neo')
  53. endfor
  54. let &selection = save
  55. End
  56. End
  57. End