aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-02-18 00:09:11 +0000
committerGitHub <noreply@github.com>2022-02-18 00:09:11 +0000
commit592f4a7c0807427355635eb371215036325e5bb8 (patch)
tree92a8dd9711da31c99f612ecca8bdc787ce6b9045 /test
parentdf0fae2ff7cd666947b752f76987bb6756e187da (diff)
parent41d0e7af2097e0374ab16fb1567cf22d21aad180 (diff)
downloadrneovim-592f4a7c0807427355635eb371215036325e5bb8.tar.gz
rneovim-592f4a7c0807427355635eb371215036325e5bb8.tar.bz2
rneovim-592f4a7c0807427355635eb371215036325e5bb8.zip
Merge pull request #17433 from seandewar/vim-8.2.3492
vim-patch:8.2.{3492,3493,3570,3573,3574,3575,3577,3601}: put overflow checking shenanigans
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/put_spec.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/functional/legacy/put_spec.lua b/test/functional/legacy/put_spec.lua
new file mode 100644
index 0000000000..0b969dee55
--- /dev/null
+++ b/test/functional/legacy/put_spec.lua
@@ -0,0 +1,45 @@
+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('put', function()
+ before_each(clear)
+ after_each(function() eq({}, meths.get_vvar('errors')) end)
+
+ it('very large count 64-bit', function()
+ if sizeoflong() < 8 then
+ pending('Skipped: only works with 64 bit long ints')
+ end
+
+ source [[
+ new
+ let @" = 'x'
+ call assert_fails('norm 44444444444444p', 'E1240:')
+ bwipe!
+ ]]
+ end)
+
+ it('very large count (visual block) 64-bit', function()
+ if sizeoflong() < 8 then
+ pending('Skipped: only works with 64 bit long ints')
+ end
+
+ source [[
+ new
+ call setline(1, 'x')
+ exe "norm \<C-V>y"
+ call assert_fails('norm 44444444444444p', 'E1240:')
+ bwipe!
+ ]]
+ end)
+end)