aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/memory_usage_spec.lua32
-rw-r--r--test/functional/provider/clipboard_spec.lua14
2 files changed, 46 insertions, 0 deletions
diff --git a/test/functional/legacy/memory_usage_spec.lua b/test/functional/legacy/memory_usage_spec.lua
index 97ac96804e..0f2d77093a 100644
--- a/test/functional/legacy/memory_usage_spec.lua
+++ b/test/functional/legacy/memory_usage_spec.lua
@@ -166,4 +166,36 @@ describe('memory usage', function()
check_result({before=before, after=after, last=last},
pcall(ok, last.last < upper))
end)
+
+ it('releases memory when closing windows when folds exist', function()
+ local pid = eval('getpid()')
+ source([[
+ new
+ " Insert lines
+ call nvim_buf_set_lines(0, 0, 0, v:false, repeat([''], 999))
+ " Create folds
+ normal! gg
+ for _ in range(500)
+ normal! zfjj
+ endfor
+ ]])
+ poke_eventloop()
+ local before = monitor_memory_usage(pid)
+ source([[
+ " Split and close window multiple times
+ for _ in range(1000)
+ split
+ close
+ endfor
+ ]])
+ poke_eventloop()
+ local after = monitor_memory_usage(pid)
+ source('bwipe!')
+ poke_eventloop()
+ -- Allow for an increase of 5% in memory usage, which accommodates minor fluctuation,
+ -- but is small enough that if memory were not released (prior to PR #14884), the test
+ -- would fail.
+ local upper = before.last * 1.05
+ check_result({before=before, after=after}, pcall(ok, after.last <= upper))
+ end)
end)
diff --git a/test/functional/provider/clipboard_spec.lua b/test/functional/provider/clipboard_spec.lua
index 2c681eb9d8..e5e21f11a6 100644
--- a/test/functional/provider/clipboard_spec.lua
+++ b/test/functional/provider/clipboard_spec.lua
@@ -506,6 +506,20 @@ describe('clipboard (with fake clipboard.vim)', function()
feed('p')
eq('textstar', meths.get_current_line())
end)
+
+ it('Block paste works currectly', function()
+ insert([[
+ aabbcc
+ ddeeff
+ ]])
+ feed('gg^<C-v>') -- Goto start of top line enter visual block mode
+ feed('3ljy^k') -- yank 4x2 block & goto initial location
+ feed('P') -- Paste it infront
+ expect([[
+ aabbaabbcc
+ ddeeddeeff
+ ]])
+ end)
end)
describe('clipboard=unnamedplus', function()