comparison src/testdir/test_memory_usage.vim @ 17172:6990c1160ea5 v8.1.1585

patch 8.1.1585: :let-heredoc does not trim enough commit https://github.com/vim/vim/commit/e7eb92708ec2092a2fc11e78703b5dcf83844412 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 24 00:58:07 2019 +0200 patch 8.1.1585: :let-heredoc does not trim enough Problem: :let-heredoc does not trim enough. Solution: Trim indent from the contents based on the indent of the first line. Use let-heredoc in more tests.
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Jun 2019 01:00:05 +0200
parents 8e9e9124c7a2
children 0da9bc55c31a
comparison
equal deleted inserted replaced
17171:1b0f624dcd8d 17172:6990c1160ea5
83 83
84 func Test_memory_func_capture_vargs() 84 func Test_memory_func_capture_vargs()
85 " Case: if a local variable captures a:000, funccall object will be free 85 " Case: if a local variable captures a:000, funccall object will be free
86 " just after it finishes. 86 " just after it finishes.
87 let testfile = 'Xtest.vim' 87 let testfile = 'Xtest.vim'
88 call writefile([ 88 let lines =<< trim END
89 \ 'func s:f(...)', 89 func s:f(...)
90 \ ' let x = a:000', 90 let x = a:000
91 \ 'endfunc', 91 endfunc
92 \ 'for _ in range(10000)', 92 for _ in range(10000)
93 \ ' call s:f(0)', 93 call s:f(0)
94 \ 'endfor', 94 endfor
95 \ ], testfile) 95 END
96 call writefile(lines, testfile)
96 97
97 let vim = s:vim_new() 98 let vim = s:vim_new()
98 call vim.start('--clean', '-c', 'set noswapfile', testfile) 99 call vim.start('--clean', '-c', 'set noswapfile', testfile)
99 let before = s:monitor_memory_usage(vim.pid).last 100 let before = s:monitor_memory_usage(vim.pid).last
100 101
120 func Test_memory_func_capture_lvars() 121 func Test_memory_func_capture_lvars()
121 " Case: if a local variable captures l: dict, funccall object will not be 122 " Case: if a local variable captures l: dict, funccall object will not be
122 " free until garbage collector runs, but after that memory usage doesn't 123 " free until garbage collector runs, but after that memory usage doesn't
123 " increase so much even when rerun Xtest.vim since system memory caches. 124 " increase so much even when rerun Xtest.vim since system memory caches.
124 let testfile = 'Xtest.vim' 125 let testfile = 'Xtest.vim'
125 call writefile([ 126 let lines =<< trim END
126 \ 'func s:f()', 127 func s:f()
127 \ ' let x = l:', 128 let x = l:
128 \ 'endfunc', 129 endfunc
129 \ 'for _ in range(10000)', 130 for _ in range(10000)
130 \ ' call s:f()', 131 call s:f()
131 \ 'endfor', 132 endfor
132 \ ], testfile) 133 END
134 call writefile(lines, testfile)
133 135
134 let vim = s:vim_new() 136 let vim = s:vim_new()
135 call vim.start('--clean', '-c', 'set noswapfile', testfile) 137 call vim.start('--clean', '-c', 'set noswapfile', testfile)
136 let before = s:monitor_memory_usage(vim.pid).last 138 let before = s:monitor_memory_usage(vim.pid).last
137 139