aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/extmark_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-05 07:09:28 +0800
committerGitHub <noreply@github.com>2023-03-05 07:09:28 +0800
commit39842be8cd8808c7da2638a6cc84d7c3fe40b996 (patch)
tree5607fc342e51de469dd97421f5d9163c2fe7f644 /test/functional/api/extmark_spec.lua
parent7100a80253a353341893e1f6397cc9e07dadbc9d (diff)
downloadrneovim-39842be8cd8808c7da2638a6cc84d7c3fe40b996.tar.gz
rneovim-39842be8cd8808c7da2638a6cc84d7c3fe40b996.tar.bz2
rneovim-39842be8cd8808c7da2638a6cc84d7c3fe40b996.zip
fix(extmarks): don't leak memory on error (#22507)
Diffstat (limited to 'test/functional/api/extmark_spec.lua')
-rw-r--r--test/functional/api/extmark_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index 3f9cb94260..30e75b8061 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -107,6 +107,13 @@ describe('API/extmarks', function()
eq("Invalid 'id': expected positive Integer", pcall_err(set_extmark, ns, {}, 0, 0, { end_col = 1, end_row = 1 }))
eq("Invalid mark position: expected 2 Integer items", pcall_err(get_extmarks, ns, {}, {-1, -1}))
eq("Invalid mark position: expected mark id Integer or 2-item Array", pcall_err(get_extmarks, ns, true, {-1, -1}))
+ -- No memory leak with virt_text, virt_lines, sign_text
+ eq("right_gravity is not a boolean", pcall_err(set_extmark, ns, marks[2], 0, 0, {
+ virt_text = {{'foo', 'Normal'}},
+ virt_lines = {{{'bar', 'Normal'}}},
+ sign_text = 'a',
+ right_gravity = 'baz',
+ }))
end)
it("can end extranges past final newline using end_col = 0", function()