Mercurial > vim
comparison src/testdir/test_terminal.vim @ 15186:2b15ee496cbd v8.1.0603
patch 8.1.0603: the :stop command is not tested
commit https://github.com/vim/vim/commit/e751a5f531c1ceb58dacc7c280fdaae0df2c71c7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 16 16:16:10 2018 +0100
patch 8.1.0603: the :stop command is not tested
Problem: The :stop command is not tested.
Solution: Test :stop using a terminal window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Dec 2018 16:30:06 +0100 |
parents | efd7bace40f4 |
children | 49bc670c3ee9 |
comparison
equal
deleted
inserted
replaced
15185:33f5df5e19f2 | 15186:2b15ee496cbd |
---|---|
1681 quit | 1681 quit |
1682 endfor | 1682 endfor |
1683 | 1683 |
1684 call delete('Xfile') | 1684 call delete('Xfile') |
1685 endfunc | 1685 endfunc |
1686 | |
1687 func Test_stop_in_terminal() | |
1688 " We can't expect this to work on all systems, just test on Linux for now. | |
1689 if !has('unix') || system('uname') !~ 'Linux' | |
1690 return | |
1691 endif | |
1692 term /bin/sh | |
1693 let bufnr = bufnr('') | |
1694 call WaitForAssert({-> assert_equal('running', term_getstatus(bufnr))}) | |
1695 let lastrow = term_getsize(bufnr)[0] | |
1696 | |
1697 call term_sendkeys(bufnr, GetVimCommandClean() . "\r") | |
1698 call term_sendkeys(bufnr, ":echo 'ready'\r") | |
1699 call WaitForAssert({-> assert_match('ready', Get_terminal_text(bufnr, lastrow))}) | |
1700 | |
1701 call term_sendkeys(bufnr, ":stop\r") | |
1702 " Not sure where "Stopped" shows up, assume in the first three lines. | |
1703 call WaitForAssert({-> assert_match('Stopped', | |
1704 \ Get_terminal_text(bufnr, 1) . | |
1705 \ Get_terminal_text(bufnr, 2) . | |
1706 \ Get_terminal_text(bufnr, 3))}) | |
1707 | |
1708 call term_sendkeys(bufnr, "fg\r") | |
1709 call term_sendkeys(bufnr, ":echo 'back again'\r") | |
1710 call WaitForAssert({-> assert_match('back again', Get_terminal_text(bufnr, lastrow))}) | |
1711 | |
1712 call term_sendkeys(bufnr, ":quit\r") | |
1713 call term_wait(bufnr) | |
1714 call Stop_shell_in_terminal(bufnr) | |
1715 exe bufnr . 'bwipe' | |
1716 endfunc |