comparison src/testdir/test_terminal.vim @ 15523:47328ce4b7aa v8.1.0769

patch 8.1.0769: :stop is covered in two tests commit https://github.com/vim/vim/commit/3020ccb113d397ddf474001dc00a1916ad7abdee Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 17 22:13:54 2019 +0100 patch 8.1.0769: :stop is covered in two tests Problem: :stop is covered in two tests. Solution: Remove Test_stop_in_terminal(). Make other test exit Vim cleanly. (Ozaki Kiichi, closes #3814)
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Jan 2019 22:15:05 +0100
parents 63b02fcf1361
children 0e39325d5ea1
comparison
equal deleted inserted replaced
15522:6c1acefc5d98 15523:47328ce4b7aa
1688 endfor 1688 endfor
1689 1689
1690 call delete('Xfile') 1690 call delete('Xfile')
1691 endfunc 1691 endfunc
1692 1692
1693 func Test_stop_in_terminal()
1694 " We can't expect this to work on all systems, just test on Linux for now.
1695 if !has('unix') || system('uname') !~ 'Linux'
1696 return
1697 endif
1698 term /bin/sh
1699 let bufnr = bufnr('')
1700 call WaitForAssert({-> assert_equal('running', term_getstatus(bufnr))})
1701 let lastrow = term_getsize(bufnr)[0]
1702
1703 call term_sendkeys(bufnr, GetVimCommandClean() . "\r")
1704 call term_sendkeys(bufnr, ":echo 'ready'\r")
1705 call WaitForAssert({-> assert_match('ready', Get_terminal_text(bufnr, lastrow))})
1706
1707 call term_sendkeys(bufnr, ":stop\r")
1708 " Not sure where "Stopped" shows up, need five lines for Arch.
1709 call WaitForAssert({-> assert_match('Stopped',
1710 \ Get_terminal_text(bufnr, 1) .
1711 \ Get_terminal_text(bufnr, 2) .
1712 \ Get_terminal_text(bufnr, 3) .
1713 \ Get_terminal_text(bufnr, 4) .
1714 \ Get_terminal_text(bufnr, 5))})
1715
1716 call term_sendkeys(bufnr, "fg\r")
1717 call term_sendkeys(bufnr, ":echo 'back again'\r")
1718 call WaitForAssert({-> assert_match('back again', Get_terminal_text(bufnr, lastrow))})
1719
1720 call term_sendkeys(bufnr, ":quit\r")
1721 call term_wait(bufnr)
1722 call Stop_shell_in_terminal(bufnr)
1723 exe bufnr . 'bwipe'
1724 endfunc
1725
1726 func Test_terminal_no_job() 1693 func Test_terminal_no_job()
1727 let term = term_start('false', {'term_finish': 'close'}) 1694 let term = term_start('false', {'term_finish': 'close'})
1728 call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) }) 1695 call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) })
1729 endfunc 1696 endfunc
1730 1697