summaryrefslogtreecommitdiff
path: root/src/testdir/test_lua.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-28 15:07:01 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-28 15:07:01 +0200
commit78e006b9b02fac94c910445d842f6dc5331fa57a (patch)
treec03873efec0f0ed556de2b98fde4353da75f1b93 /src/testdir/test_lua.vim
parente2390c7f32879ab7942adf0d38b1db34933695fa (diff)
downloadvim-git-78e006b9b02fac94c910445d842f6dc5331fa57a.tar.gz
patch 8.2.3234: crash when printing long string with Luav8.2.3234
Problem: Crash when printing long string with Lua. Solution: Remove lua_pop(). (Martin Tournoij, closes #8648)
Diffstat (limited to 'src/testdir/test_lua.vim')
-rw-r--r--src/testdir/test_lua.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim
index c33056319..2f204048f 100644
--- a/src/testdir/test_lua.vim
+++ b/src/testdir/test_lua.vim
@@ -850,6 +850,24 @@ func Test_luafile_error()
bwipe!
endfunc
+" Test :luafile printing a long string
+func Test_luafile_print()
+ new Xlua_file
+ let lines =<< trim END
+ local data = ''
+ for i = 1, 130 do
+ data = data .. 'xxxxx asd as as dad sad sad xz cxz czxcxzczxc ad ad asd asd asd asd asd'
+ end
+ print(data)
+ END
+ call setline(1, lines)
+ w
+ luafile %
+
+ call delete('Xlua_file')
+ bwipe!
+endfunc
+
" Test for dealing with strings containing newlines and null character
func Test_lua_string_with_newline()
let x = execute('lua print("Hello\nWorld")')