To: vim_dev@googlegroups.com Subject: Patch 8.1.2067 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2067 Problem: No tests for SafeState and SafeStateAgain. Solution: Add tests. Files: src/testdir/test_autocmd.vim *** ../vim-8.1.2066/src/testdir/test_autocmd.vim 2019-09-01 14:45:23.753964955 +0200 --- src/testdir/test_autocmd.vim 2019-09-22 21:44:17.727603154 +0200 *************** *** 2,7 **** --- 2,8 ---- source shared.vim source check.vim + source term_util.vim func s:cleanup_buffers() abort for bnr in range(1, bufnr('$')) *************** *** 2225,2227 **** --- 2226,2258 ---- bwipe! au! throwing endfunc + + func Test_autocmd_SafeState() + CheckRunVimInTerminal + + let lines =<< trim END + let g:safe = 0 + let g:again = '' + au SafeState * let g:safe += 1 + au SafeStateAgain * let g:again ..= 'x' + func CallTimer() + call timer_start(10, {id -> execute('let g:again ..= "t"')}) + endfunc + END + call writefile(lines, 'XSafeState') + let buf = RunVimInTerminal('-S XSafeState', #{rows: 6}) + + call term_sendkeys(buf, ":echo g:safe\") + call WaitForAssert({-> assert_match('^2 ', term_getline(buf, 6))}, 1000) + + call term_sendkeys(buf, ":echo g:again\") + call WaitForAssert({-> assert_match('^xxxx', term_getline(buf, 6))}, 1000) + + call term_sendkeys(buf, ":let g:again = ''\:call CallTimer()\") + call term_wait(buf) + call term_sendkeys(buf, ":echo g:again\") + call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) + + call StopVimInTerminal(buf) + call delete('XSafeState') + endfunc *** ../vim-8.1.2066/src/version.c 2019-09-22 21:29:49.659426007 +0200 --- src/version.c 2019-09-22 21:36:56.633504652 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 2067, /**/ -- Even got a Datapoint 3600(?) with a DD50 connector instead of the usual DB25... what a nightmare trying to figure out the pinout for *that* with no spex... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///