]> git.madduck.net Git - etc/vim.git/blobdiff - .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
diff --git a/.vim/bundle/vim-lsp/test/lsp/utils/range.vimspec b/.vim/bundle/vim-lsp/test/lsp/utils/range.vimspec
new file mode 100644 (file)
index 0000000..af81024
--- /dev/null
@@ -0,0 +1,61 @@
+Describe lsp#utils#range
+
+  Before each
+    % delete _
+  End
+
+  Describe lsp#utils#range#_get_recent_visual_range
+
+    It should return single line visual selection
+      call setline(1, ['あいうえお'])
+      normal! gg0llvly
+      Assert Equals(lsp#utils#range#_get_recent_visual_range(), {
+            \   'start': {
+            \     'line': 0,
+            \     'character': 2
+            \   },
+            \   'end': {
+            \     'line': 0,
+            \     'character': 4
+            \   }
+            \ })
+    End
+
+    It should return multi line visual selection
+      call setline(1, ['あいうえお', 'かきくけこ'])
+      normal! gg0llvjly
+      Assert Equals(lsp#utils#range#_get_recent_visual_range(), {
+            \   'start': {
+            \     'line': 0,
+            \     'character': 2
+            \   },
+            \   'end': {
+            \     'line': 1,
+            \     'character': 4
+            \   }
+            \ })
+    End
+
+  End
+
+  Describe lsp#utils#range#_get_current_line_range
+
+    It should return current line range
+      call setline(1, ['あいうえお', 'かきくけこ', 'さしすせそ'])
+      call cursor(2, 1)
+      Assert Equals(lsp#utils#range#_get_current_line_range(), {
+            \   'start': {
+            \     'line': 1,
+            \     'character': 0
+            \   },
+            \   'end': {
+            \     'line': 1,
+            \     'character': 5
+            \   }
+            \ })
+    End
+
+  End
+
+End
+