mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Add test
This commit is contained in:
@@ -527,6 +527,30 @@ Describe lsp#utils#text_edit
|
||||
" Make sure v:completed_item is not changed
|
||||
Assert Equals(v:completed_item, l:old_completed_item)
|
||||
End
|
||||
|
||||
It replaces entire buffer correctly when end column is 1
|
||||
call s:set_text(['foo', 'b'])
|
||||
|
||||
call lsp#utils#text_edit#apply_text_edits(
|
||||
\ expand('%'),
|
||||
\ [{
|
||||
\ 'range': {
|
||||
\ 'start': {
|
||||
\ 'line': 0,
|
||||
\ 'character': 0
|
||||
\ },
|
||||
\ 'end': {
|
||||
\ 'line': 1,
|
||||
\ 'character': 1
|
||||
\ }
|
||||
\ },
|
||||
\ 'newText': "x\ny\nz\n"
|
||||
\ }])
|
||||
|
||||
let l:buffer_text = s:get_text()
|
||||
Assert Equals(l:buffer_text, ['x', 'y', 'z', 'b', ''])
|
||||
End
|
||||
|
||||
End
|
||||
End
|
||||
|
||||
|
||||
Reference in New Issue
Block a user