Mercurial > vim
comparison src/testdir/test_terminal.vim @ 12734:810a4c3d4f7e v8.0.1245
patch 8.0.1245: when WaitFor() has a wrong expression it just waits a second
commit https://github.com/vim/vim/commit/3e1c617d49224038a820ee2c552ebe31a84aaa89
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 2 16:58:00 2017 +0100
patch 8.0.1245: when WaitFor() has a wrong expression it just waits a second
Problem: When WaitFor() has a wrong expression it just waits a second,
which goes unnoticed. (James McCoy)
Solution: When WaitFor() times out throw an exception. Fix places where the
expression was wrong.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 02 Nov 2017 17:00:08 +0100 |
parents | 17c257dd2438 |
children | c1347c968d31 |
comparison
equal
deleted
inserted
replaced
12733:61937df27f3a | 12734:810a4c3d4f7e |
---|---|
703 let lnum = [1, 3, 5] | 703 let lnum = [1, 3, 5] |
704 endif | 704 endif |
705 | 705 |
706 enew | 706 enew |
707 let buf = term_start(cmd, {'curwin': bufnr('')}) | 707 let buf = term_start(cmd, {'curwin': bufnr('')}) |
708 let job = term_getjob(buf) | 708 let g:job = term_getjob(buf) |
709 call term_wait(buf, 50) | 709 call term_wait(buf, 50) |
710 | 710 |
711 " ascii + composing | 711 " ascii + composing |
712 let txt = "a\u0308bc" | 712 let txt = "a\u0308bc" |
713 call term_sendkeys(buf, "echo " . txt . "\r") | 713 call term_sendkeys(buf, "echo " . txt . "\r") |
740 call assert_equal(txt, term_getline(buf, lnum[2] + 1)) | 740 call assert_equal(txt, term_getline(buf, lnum[2] + 1)) |
741 let l = term_scrape(buf, lnum[2] + 1) | 741 let l = term_scrape(buf, lnum[2] + 1) |
742 call assert_equal("\u00a0\u0308", l[3].chars) | 742 call assert_equal("\u00a0\u0308", l[3].chars) |
743 | 743 |
744 call term_sendkeys(buf, "exit\r") | 744 call term_sendkeys(buf, "exit\r") |
745 call WaitFor('job_status(job) == "dead"') | 745 call WaitFor('job_status(g:job) == "dead"') |
746 call assert_equal('dead', job_status(job)) | 746 call assert_equal('dead', job_status(g:job)) |
747 bwipe! | 747 bwipe! |
748 unlet g:job | |
748 let &encoding = save_enc | 749 let &encoding = save_enc |
749 endfunc | 750 endfunc |