diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-12-16 09:27:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 09:27:39 -0700 |
commit | 4240ce8eb38ee9c89ce8694faab37e8db8fca209 (patch) | |
tree | 559755e804f4b99ab6a1d558442141301d3b7392 /test/functional/terminal | |
parent | 56fa08b458cbf98fa83c21c3e683f8e7e91a334f (diff) | |
download | rneovim-4240ce8eb38ee9c89ce8694faab37e8db8fca209.tar.gz rneovim-4240ce8eb38ee9c89ce8694faab37e8db8fca209.tar.bz2 rneovim-4240ce8eb38ee9c89ce8694faab37e8db8fca209.zip |
perf: pre-compile embedded Lua source into bytecode (#16631)
The Lua modules that make up vim.lua are embedded as raw source files into the
nvim binary. These sources are loaded by the Lua runtime on startuptime. We can
pre-compile these sources into Lua bytecode before embedding them into the
binary, which minimizes the size of the binary and improves startuptime.
Diffstat (limited to 'test/functional/terminal')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 7113cc1b49..bf57b135cb 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -20,6 +20,7 @@ local nvim_prog = helpers.nvim_prog local nvim_set = helpers.nvim_set local ok = helpers.ok local read_file = helpers.read_file +local exec_lua = helpers.exec_lua if helpers.pending_win32(pending) then return end @@ -580,21 +581,34 @@ describe('TUI', function() end) it("paste: 'nomodifiable' buffer", function() + local has_luajit = exec_lua('return jit ~= nil') child_session:request('nvim_command', 'set nomodifiable') child_session:request('nvim_exec_lua', [[ -- Stack traces for this test are non-deterministic, so disable them _G.debug.traceback = function(msg) return msg end ]], {}) feed_data('\027[200~fail 1\nfail 2\n\027[201~') - screen:expect{grid=[[ - | - {4:~ }| - {5: }| - {8:paste: Error executing lua: vim.lua:243: Vim:E21: }| - {8:Cannot make changes, 'modifiable' is off} | - {10:Press ENTER or type command to continue}{1: } | - {3:-- TERMINAL --} | - ]]} + if has_luajit then + screen:expect{grid=[[ + | + {4:~ }| + {5: }| + {8:paste: Error executing lua: vim.lua:0: Vim:E21: Ca}| + {8:nnot make changes, 'modifiable' is off} | + {10:Press ENTER or type command to continue}{1: } | + {3:-- TERMINAL --} | + ]]} + else + screen:expect{grid=[[ + | + {4:~ }| + {5: }| + {8:paste: Error executing lua: Vim:E21: Cannot make c}| + {8:hanges, 'modifiable' is off} | + {10:Press ENTER or type command to continue}{1: } | + {3:-- TERMINAL --} | + ]]} + end feed_data('\n') -- <Enter> child_session:request('nvim_command', 'set modifiable') feed_data('\027[200~success 1\nsuccess 2\n\027[201~') |