diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-10-30 09:49:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 09:49:50 +0100 |
commit | efa9152852eb40b65876fc1422da72de477d30e6 (patch) | |
tree | 59845be91ce3fd8681b3a10e3569bdd99a6a57a5 /src/nvim/testdir | |
parent | 45296b331fa462eeabb141037ad10a3ad24ab8a6 (diff) | |
parent | cc7285823cda56aeb1ce16e03990c3397e315a2e (diff) | |
download | rneovim-efa9152852eb40b65876fc1422da72de477d30e6.tar.gz rneovim-efa9152852eb40b65876fc1422da72de477d30e6.tar.bz2 rneovim-efa9152852eb40b65876fc1422da72de477d30e6.zip |
Merge #7456 from justinmk/vim-8.0.1207
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_profile.vim | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_profile.vim b/src/nvim/testdir/test_profile.vim index 183f52b8ac..4cbd800da5 100644 --- a/src/nvim/testdir/test_profile.vim +++ b/src/nvim/testdir/test_profile.vim @@ -115,7 +115,7 @@ func Test_profile_file() call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3]) call assert_equal('', lines[4]) call assert_equal('count total (s) self (s)', lines[5]) - call assert_equal(' func! Foo()', lines[6]) + call assert_match(' 2 0.\d\+ func! Foo()', lines[6]) call assert_equal(' endfunc', lines[7]) " Loop iterates 10 times. Since script runs twice, body executes 20 times. " First line of loop executes one more time than body to detect end of loop. @@ -132,6 +132,42 @@ func Test_profile_file() call delete('Xprofile_file.log') endfunc +func Test_profile_file_with_cont() + let lines = [ + \ 'echo "hello', + \ ' \ world"', + \ 'echo "foo ', + \ ' \bar"', + \ ] + + call writefile(lines, 'Xprofile_file.vim') + call system(v:progpath + \ . ' -es -u NONE -U NONE -i NONE --noplugin' + \ . ' -c "profile start Xprofile_file.log"' + \ . ' -c "profile file Xprofile_file.vim"' + \ . ' -c "so Xprofile_file.vim"' + \ . ' -c "qall!"') + call assert_equal(0, v:shell_error) + + let lines = readfile('Xprofile_file.log') + call assert_equal(11, len(lines)) + + call assert_match('^SCRIPT .*Xprofile_file.vim$', lines[0]) + call assert_equal('Sourced 1 time', lines[1]) + call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2]) + call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3]) + call assert_equal('', lines[4]) + call assert_equal('count total (s) self (s)', lines[5]) + call assert_match(' 1 0.\d\+ echo "hello', lines[6]) + call assert_equal(' \ world"', lines[7]) + call assert_match(' 1 0.\d\+ echo "foo ', lines[8]) + call assert_equal(' \bar"', lines[9]) + call assert_equal('', lines[10]) + + call delete('Xprofile_file.vim') + call delete('Xprofile_file.log') +endfunc + func Test_profile_completion() call feedkeys(":profile \<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"profile continue dump file func pause start stop', @:) |