diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-18 10:15:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 10:15:08 +0800 |
commit | faeff49cbfd190afba67e221412b7132b7ad8360 (patch) | |
tree | bb6260556f056982e51f6dda99bd882e650cafcc /test/functional/legacy/excmd_spec.lua | |
parent | 592f4a7c0807427355635eb371215036325e5bb8 (diff) | |
parent | 62a1290758a3cd6af95dc47a3bbdc7dcf290d531 (diff) | |
download | rneovim-faeff49cbfd190afba67e221412b7132b7ad8360.tar.gz rneovim-faeff49cbfd190afba67e221412b7132b7ad8360.tar.bz2 rneovim-faeff49cbfd190afba67e221412b7132b7ad8360.zip |
Merge pull request #17449 from zeertzjq/vim-8.2.3659
vim-patch:8.2.{3659,3660,3661}: integer overflow with large line number
Diffstat (limited to 'test/functional/legacy/excmd_spec.lua')
-rw-r--r-- | test/functional/legacy/excmd_spec.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua new file mode 100644 index 0000000000..174f7d292e --- /dev/null +++ b/test/functional/legacy/excmd_spec.lua @@ -0,0 +1,32 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local exec_lua = helpers.exec_lua +local meths = helpers.meths +local source = helpers.source +local eq = helpers.eq + +local function sizeoflong() + if not exec_lua('return pcall(require, "ffi")') then + pending('missing LuaJIT FFI') + end + return exec_lua('return require("ffi").sizeof(require("ffi").typeof("long"))') +end + +describe('Ex command', function() + before_each(clear) + after_each(function() eq({}, meths.get_vvar('errors')) end) + + it('checks for address line overflow', function() + if sizeoflong() < 8 then + pending('Skipped: only works with 64 bit long ints') + end + + source [[ + new + call setline(1, 'text') + call assert_fails('|.44444444444444444444444', 'E1247:') + call assert_fails('|.9223372036854775806', 'E1247:') + bwipe! + ]] + end) +end) |