comparison src/testdir/test_prompt_buffer.vim @ 21765:08940efa6b4e v8.2.1432

patch 8.2.1432: various inconsistencies in test files Commit: https://github.com/vim/vim/commit/6d91bcb4d23b5c6a0be72c384beaf385e2d9d606 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 12 18:50:36 2020 +0200 patch 8.2.1432: various inconsistencies in test files Problem: Various inconsistencies in test files. Solution: Add modelines where they were missing. Use Check commands instead of silently skipping over tests. Adjust indents and comments. (Ken Takata, closes #6695)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Aug 2020 19:00:08 +0200
parents 505d97ea54da
children 335365fcbb60
comparison
equal deleted inserted replaced
21764:476b6faad407 21765:08940efa6b4e
7 source screendump.vim 7 source screendump.vim
8 8
9 func CanTestPromptBuffer() 9 func CanTestPromptBuffer()
10 " We need to use a terminal window to be able to feed keys without leaving 10 " We need to use a terminal window to be able to feed keys without leaving
11 " Insert mode. 11 " Insert mode.
12 if !has('terminal') 12 CheckFeature terminal
13 return 0 13
14 endif 14 " TODO: make the tests work on MS-Windows
15 if has('win32') 15 CheckNotMSWindows
16 " TODO: make the tests work on MS-Windows
17 return 0
18 endif
19 return 1
20 endfunc 16 endfunc
21 17
22 func WriteScript(name) 18 func WriteScript(name)
23 call writefile([ 19 call writefile([
24 \ 'func TextEntered(text)', 20 \ 'func TextEntered(text)',
52 \ 'startinsert', 48 \ 'startinsert',
53 \ ], a:name) 49 \ ], a:name)
54 endfunc 50 endfunc
55 51
56 func Test_prompt_basic() 52 func Test_prompt_basic()
57 if !CanTestPromptBuffer() 53 call CanTestPromptBuffer()
58 return
59 endif
60 let scriptName = 'XpromptscriptBasic' 54 let scriptName = 'XpromptscriptBasic'
61 call WriteScript(scriptName) 55 call WriteScript(scriptName)
62 56
63 let buf = RunVimInTerminal('-S ' . scriptName, {}) 57 let buf = RunVimInTerminal('-S ' . scriptName, {})
64 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))}) 58 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})
74 call StopVimInTerminal(buf) 68 call StopVimInTerminal(buf)
75 call delete(scriptName) 69 call delete(scriptName)
76 endfunc 70 endfunc
77 71
78 func Test_prompt_editing() 72 func Test_prompt_editing()
79 if !CanTestPromptBuffer() 73 call CanTestPromptBuffer()
80 return
81 endif
82 let scriptName = 'XpromptscriptEditing' 74 let scriptName = 'XpromptscriptEditing'
83 call WriteScript(scriptName) 75 call WriteScript(scriptName)
84 76
85 let buf = RunVimInTerminal('-S ' . scriptName, {}) 77 let buf = RunVimInTerminal('-S ' . scriptName, {})
86 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))}) 78 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})