To: vim_dev@googlegroups.com Subject: Patch 8.2.0198 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0198 Problem: No tests for y/n prompt. Solution: Add tests. (Dominique Pelle, closes #5564) Files: src/testdir/test_messages.vim *** ../vim-8.2.0197/src/testdir/test_messages.vim 2020-01-08 19:27:35.339668702 +0100 --- src/testdir/test_messages.vim 2020-02-02 15:53:28.945328328 +0100 *************** *** 265,271 **** call term_sendkeys(buf, 'q') call WaitForAssert({-> assert_equal('100', term_getline(buf, 5))}) ! call term_sendkeys(buf, ':q!') call StopVimInTerminal(buf) endfunc --- 265,301 ---- call term_sendkeys(buf, 'q') call WaitForAssert({-> assert_equal('100', term_getline(buf, 5))}) ! call term_sendkeys(buf, ":q!\n") ! call StopVimInTerminal(buf) ! endfunc ! ! func Test_ask_yesno() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot run vim in terminal' ! endif ! let buf = RunVimInTerminal('', {'rows': 6}) ! call term_sendkeys(buf, ":call setline(1, range(1, 2))\n") ! ! call term_sendkeys(buf, ":2,1s/^/n/\n") ! call WaitForAssert({-> assert_equal('Backwards range given, OK to swap (y/n)?', term_getline(buf, 6))}) ! call term_sendkeys(buf, "n") ! call WaitForAssert({-> assert_match('^Backwards range given, OK to swap (y/n)?n *1,1 *All$', term_getline(buf, 6))}) ! call WaitForAssert({-> assert_equal('1', term_getline(buf, 1))}) ! ! call term_sendkeys(buf, ":2,1s/^/Esc/\n") ! call WaitForAssert({-> assert_equal('Backwards range given, OK to swap (y/n)?', term_getline(buf, 6))}) ! call term_sendkeys(buf, "\") ! call WaitForAssert({-> assert_match('^Backwards range given, OK to swap (y/n)?n *1,1 *All$', term_getline(buf, 6))}) ! call WaitForAssert({-> assert_equal('1', term_getline(buf, 1))}) ! ! call term_sendkeys(buf, ":2,1s/^/y/\n") ! call WaitForAssert({-> assert_equal('Backwards range given, OK to swap (y/n)?', term_getline(buf, 6))}) ! call term_sendkeys(buf, "y") ! call WaitForAssert({-> assert_match('^Backwards range given, OK to swap (y/n)?y *2,1 *All$', term_getline(buf, 6))}) ! call WaitForAssert({-> assert_equal('y1', term_getline(buf, 1))}) ! call WaitForAssert({-> assert_equal('y2', term_getline(buf, 2))}) ! ! call term_sendkeys(buf, ":q!\n") call StopVimInTerminal(buf) endfunc *** ../vim-8.2.0197/src/version.c 2020-02-02 15:32:09.967762406 +0100 --- src/version.c 2020-02-02 15:55:01.828936130 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 198, /**/ -- How To Keep A Healthy Level Of Insanity: 3. Every time someone asks you to do something, ask if they want fries with that. /// 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 ///