comparison src/testdir/test_terminal.vim @ 12118:bf53df1f17ba v8.0.0939

patch 8.0.0939: Test_terminal_env is flaky commit https://github.com/vim/vim/commit/51c23687a9298c27d41ad9780b032f434e1e1646 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 14 21:45:00 2017 +0200 patch 8.0.0939: Test_terminal_env is flaky Problem: Test_terminal_env is flaky. (James McCoy) Solution: Use WaitFor() instead of term_wait().
author Christian Brabandt <cb@256bit.org>
date Mon, 14 Aug 2017 22:00:06 +0200
parents 6afc7339c2ad
children 017031c7717e
comparison
equal deleted inserted replaced
12117:b8426b79c762 12118:bf53df1f17ba
408 func Test_terminal_env() 408 func Test_terminal_env()
409 if !has('unix') 409 if !has('unix')
410 return 410 return
411 endif 411 endif
412 let buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}}) 412 let buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
413 call term_wait(buf) 413 " Wait for the shell to display a prompt
414 call WaitFor('term_getline(1) != ""')
414 call term_sendkeys(buf, "echo $TESTENV\r") 415 call term_sendkeys(buf, "echo $TESTENV\r")
415 call term_wait(buf) 416 call term_wait(buf)
416 call Stop_shell_in_terminal(buf) 417 call Stop_shell_in_terminal(buf)
417 call term_wait(buf) 418 call WaitFor('getline(2) == "correct"')
418 call assert_equal('correct', getline(2)) 419 call assert_equal('correct', getline(2))
419 420
420 exe buf . 'bwipe' 421 exe buf . 'bwipe'
421 endfunc 422 endfunc
422 423