]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp/test/lsp/utils/range.vimspec

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / vim-lsp / test / lsp / utils / range.vimspec
1 Describe lsp#utils#range
2
3   Before each
4     % delete _
5   End
6
7   Describe lsp#utils#range#_get_recent_visual_range
8
9     It should return single line visual selection
10       call setline(1, ['あいうえお'])
11       normal! gg0llvly
12       Assert Equals(lsp#utils#range#_get_recent_visual_range(), {
13             \   'start': {
14             \     'line': 0,
15             \     'character': 2
16             \   },
17             \   'end': {
18             \     'line': 0,
19             \     'character': 4
20             \   }
21             \ })
22     End
23
24     It should return multi line visual selection
25       call setline(1, ['あいうえお', 'かきくけこ'])
26       normal! gg0llvjly
27       Assert Equals(lsp#utils#range#_get_recent_visual_range(), {
28             \   'start': {
29             \     'line': 0,
30             \     'character': 2
31             \   },
32             \   'end': {
33             \     'line': 1,
34             \     'character': 4
35             \   }
36             \ })
37     End
38
39   End
40
41   Describe lsp#utils#range#_get_current_line_range
42
43     It should return current line range
44       call setline(1, ['あいうえお', 'かきくけこ', 'さしすせそ'])
45       call cursor(2, 1)
46       Assert Equals(lsp#utils#range#_get_current_line_range(), {
47             \   'start': {
48             \     'line': 1,
49             \     'character': 0
50             \   },
51             \   'end': {
52             \     'line': 1,
53             \     'character': 5
54             \   }
55             \ })
56     End
57
58   End
59
60 End
61