aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-10-30 15:10:11 -0700
committerJames McCoy <jamessan@jamessan.com>2016-12-12 10:17:35 -0500
commit25438f149fda66375ed54a735e4477f3f4d87338 (patch)
treef36858650c2adeee6e2b6aa1f305badf054614f1 /src/nvim/testdir
parente97e24c77e70ec8bdaca51b0b477ca0c38ea35e0 (diff)
downloadrneovim-25438f149fda66375ed54a735e4477f3f4d87338.tar.gz
rneovim-25438f149fda66375ed54a735e4477f3f4d87338.tar.bz2
rneovim-25438f149fda66375ed54a735e4477f3f4d87338.zip
vim-patch:7.4.1719
Problem: Leaking memory when there is a cycle involving a job and a partial. Solution: Add a copyID to job and channel. Set references in items referred by them. Go through all jobs and channels to find unreferenced items. Also, decrement reference counts when garbage collecting. https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_partial.vim19
-rw-r--r--src/nvim/testdir/test_timers.vim13
2 files changed, 30 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_partial.vim b/src/nvim/testdir/test_partial.vim
index b5909910c7..7562c7fd2a 100644
--- a/src/nvim/testdir/test_partial.vim
+++ b/src/nvim/testdir/test_partial.vim
@@ -193,7 +193,7 @@ func Test_redefine_dict_func()
endtry
endfunc
-" This causes double free on exit if EXITFREE is defined.
+" This caused double free on exit if EXITFREE is defined.
func Test_cyclic_list_arg()
let l = []
let Pt = function('string', [l])
@@ -202,7 +202,7 @@ func Test_cyclic_list_arg()
unlet Pt
endfunc
-" This causes double free on exit if EXITFREE is defined.
+" This caused double free on exit if EXITFREE is defined.
func Test_cyclic_dict_arg()
let d = {}
let Pt = function('string', [d])
@@ -211,6 +211,21 @@ func Test_cyclic_dict_arg()
unlet Pt
endfunc
+func Ignored(job1, job2, status)
+endfunc
+
+" func Test_cycle_partial_job()
+" let job = job_start('echo')
+" call job_setoptions(job, {'exit_cb': function('Ignored', [job])})
+" unlet job
+" endfunc
+
+" func Test_ref_job_partial_dict()
+" let g:ref_job = job_start('echo')
+" let d = {'a': 'b'}
+" call job_setoptions(g:ref_job, {'exit_cb': function('string', [], d)})
+" endfunc
+
func Test_auto_partial_rebind()
let dict1 = {'name': 'dict1'}
func! dict1.f1()
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index 9f58a35909..abf4e43ec3 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -30,3 +30,16 @@ func Test_repeat_many()
call assert_true(s:val > 1)
call assert_true(s:val < 5)
endfunc
+
+" func Test_with_partial_callback()
+" let s:val = 0
+" let s:meow = {}
+" function s:meow.bite(...)
+" let s:val += 1
+" endfunction
+
+" call timer_start(50, s:meow.bite)
+" sleep 200m
+" call assert_equal(1, s:val)
+" endfunc
+" vim: ts=2 sw=0 et