diff options
Diffstat (limited to 'test/test_code_action.vader')
-rw-r--r-- | test/test_code_action.vader | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/test_code_action.vader b/test/test_code_action.vader index 7eabb759..c613222c 100644 --- a/test/test_code_action.vader +++ b/test/test_code_action.vader @@ -1,14 +1,7 @@ Before: Save g:ale_enabled - let g:ale_enabled = 0 - " Enable fix end-of-line as tests below expect that - set fixeol - - runtime autoload/ale/code_action.vim - runtime autoload/ale/util.vim - let g:file1 = tempname() let g:file2 = tempname() let g:test = {} @@ -42,8 +35,6 @@ Before: endfunction! After: - Restore - " Close the extra buffers if we opened it. if bufnr(g:file1) != -1 execute ':bp! | :bd! ' . bufnr(g:file1) @@ -65,8 +56,7 @@ After: unlet! g:changes delfunction WriteFileAndEdit - runtime autoload/ale/code_action.vim - runtime autoload/ale/util.vim + Restore Execute(It should modify and save multiple files): @@ -214,7 +204,6 @@ Execute(End of file can be modified): \) AssertEqual g:test.text + [ - \ '', \ 'type A: string', \ 'type B: number', \ '', @@ -364,6 +353,15 @@ Execute(Cursor will not move when changes happening on lines >= cursor, but afte AssertEqual ' value: number', getline('.') AssertEqual [2, 3], getpos('.')[1:2] +Execute(Cursor will not move when change covers entire file): + call WriteFileAndEdit() + call setpos('.', [0, 2, 3, 0]) + call ale#code_action#HandleCodeAction( + \ g:test.create_change(1, 1, len(g:test.text) + 1, 1, + \ join(g:test.text + ['x'], "\n")), + \ {'should_save': 1}) + AssertEqual [2, 3], getpos('.')[1:2] + Execute(It should just modify file when should_save is set to v:false): call WriteFileAndEdit() let g:test.change = g:test.create_change(1, 1, 1, 1, "import { writeFile } from 'fs';\n") |