diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-18 19:11:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 19:11:44 +0800 |
commit | b8c34efe3399b0786a0e00012cfa3a05a4aa4654 (patch) | |
tree | 5cf06572e1aa937f048faec77c63bc4e98837152 /test/functional/lua/luaeval_spec.lua | |
parent | 796df966f3cb83698035b85522504d40e7b5ab0b (diff) | |
download | rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.tar.gz rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.tar.bz2 rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.zip |
fix(eval): skip over v:lua properly (#27517)
Problem: Error when parsing v:lua in a ternary expression.
Solution: Set rettv->v_type for v:lua even if not evaluating.
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
-rw-r--r-- | test/functional/lua/luaeval_spec.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index 171d37ba55..b28cfa4dd2 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -538,6 +538,8 @@ describe('v:lua', function() eq('\tbadval', eval("v:lua.require'leftpad'('badval')")) eq(9003, eval("v:lua.require'bar'.doit()")) eq(9004, eval("v:lua.require'baz-quux'.doit()")) + eq(9003, eval("1 ? v:lua.require'bar'.doit() : v:lua.require'baz-quux'.doit()")) + eq(9004, eval("0 ? v:lua.require'bar'.doit() : v:lua.require'baz-quux'.doit()")) end) it('throw errors for invalid use', function() |