summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_lua.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_lua.vim')
-rw-r--r--src/testdir/test_lua.vim22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim
index 7e72728289..a99affc047 100644
--- a/src/testdir/test_lua.vim
+++ b/src/testdir/test_lua.vim
@@ -28,21 +28,37 @@ func TearDown()
endfunc
" Check that switching to another buffer does not trigger ml_get error.
-func Test_lua_command_new_no_ml_get_error()
+func Test_lua_luado_change_buffer()
new
+
let wincount = winnr('$')
call setline(1, ['one', 'two', 'three'])
luado vim.command("new")
call assert_equal(wincount + 1, winnr('$'))
+
%bwipe!
endfunc
-" Test vim.command()
-func Test_lua_command()
+" Check that :luado deleting lines does not trigger ml_get error.
+func Test_lua_luado_delete_lines()
new
+
+ call setline(1, ['one', 'two', 'three'])
+ luado vim.command("%d_")
+ call assert_equal([''], getline(1, '$'))
+
call setline(1, ['one', 'two', 'three'])
luado vim.command("1,2d_")
call assert_equal(['three'], getline(1, '$'))
+
+ call setline(1, ['one', 'two', 'three'])
+ luado vim.command("2,3d_"); return "REPLACED"
+ call assert_equal(['REPLACED'], getline(1, '$'))
+
+ call setline(1, ['one', 'two', 'three'])
+ 2,3luado vim.command("1,2d_"); return "REPLACED"
+ call assert_equal(['three'], getline(1, '$'))
+
bwipe!
endfunc