annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for setting 'buftype' to "prompt"
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
3 source check.vim
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
4 CheckFeature channel
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 source shared.vim
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 source screendump.vim
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
9 func CanTestPromptBuffer()
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 " We need to use a terminal window to be able to feed keys without leaving
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 " Insert mode.
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
12 CheckFeature terminal
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
13
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
14 " TODO: make the tests work on MS-Windows
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
15 CheckNotMSWindows
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
16 endfunc
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
17
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
18 func WriteScript(name)
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call writefile([
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'func TextEntered(text)',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ ' if a:text == "exit"',
14149
fba38a3491f5 patch 8.1.0092: prompt buffer test fails
Christian Brabandt <cb@256bit.org>
parents: 14029
diff changeset
22 \ ' " Reset &modified to allow the buffer to be closed.',
fba38a3491f5 patch 8.1.0092: prompt buffer test fails
Christian Brabandt <cb@256bit.org>
parents: 14029
diff changeset
23 \ ' set nomodified',
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ ' stopinsert',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 \ ' close',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 \ ' else',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 \ ' " Add the output above the current prompt.',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 \ ' call append(line("$") - 1, "Command: \"" . a:text . "\"")',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 \ ' " Reset &modified to allow the buffer to be closed.',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 \ ' set nomodified',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ ' call timer_start(20, {id -> TimerFunc(a:text)})',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ ' endif',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ 'endfunc',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ '',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 \ 'func TimerFunc(text)',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 \ ' " Add the output above the current prompt.',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 \ ' call append(line("$") - 1, "Result: \"" . a:text . "\"")',
14025
eb5ee7479d31 patch 8.1.0030: stoping Vim running in a terminal may not work
Christian Brabandt <cb@256bit.org>
parents: 14021
diff changeset
38 \ ' " Reset &modified to allow the buffer to be closed.',
eb5ee7479d31 patch 8.1.0030: stoping Vim running in a terminal may not work
Christian Brabandt <cb@256bit.org>
parents: 14021
diff changeset
39 \ ' set nomodified',
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 \ 'endfunc',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 \ '',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 \ 'call setline(1, "other buffer")',
14025
eb5ee7479d31 patch 8.1.0030: stoping Vim running in a terminal may not work
Christian Brabandt <cb@256bit.org>
parents: 14021
diff changeset
43 \ 'set nomodified',
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 \ 'new',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 \ 'set buftype=prompt',
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ 'call prompt_setcallback(bufnr(""), function("TextEntered"))',
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
47 \ 'eval bufnr("")->prompt_setprompt("cmd: ")',
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ 'startinsert',
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
49 \ ], a:name)
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
50 endfunc
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
51
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
52 func Test_prompt_basic()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
53 call CanTestPromptBuffer()
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
54 let scriptName = 'XpromptscriptBasic'
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
55 call WriteScript(scriptName)
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
56
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
57 let buf = RunVimInTerminal('-S ' . scriptName, {})
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
58 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call term_sendkeys(buf, "hello\<CR>")
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
61 call WaitForAssert({-> assert_equal('cmd: hello', term_getline(buf, 1))})
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 call WaitForAssert({-> assert_equal('Command: "hello"', term_getline(buf, 2))})
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 call WaitForAssert({-> assert_equal('Result: "hello"', term_getline(buf, 3))})
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 call term_sendkeys(buf, "exit\<CR>")
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 call WaitForAssert({-> assert_equal('other buffer', term_getline(buf, 1))})
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 call StopVimInTerminal(buf)
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
69 call delete(scriptName)
14019
dc67449d648c patch 8.1.0027: difficult to make a plugin that feeds a line to a job
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 endfunc
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
71
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
72 func Test_prompt_editing()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 20941
diff changeset
73 call CanTestPromptBuffer()
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
74 let scriptName = 'XpromptscriptEditing'
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
75 call WriteScript(scriptName)
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
76
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
77 let buf = RunVimInTerminal('-S ' . scriptName, {})
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
78 call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
79
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
80 let bs = "\<BS>"
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
81 call term_sendkeys(buf, "hello" . bs . bs)
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
82 call WaitForAssert({-> assert_equal('cmd: hel', term_getline(buf, 1))})
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
83
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
84 let left = "\<Left>"
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
85 call term_sendkeys(buf, left . left . left . bs . '-')
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
86 call WaitForAssert({-> assert_equal('cmd: -hel', term_getline(buf, 1))})
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
87
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
88 let end = "\<End>"
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
89 call term_sendkeys(buf, end . "x")
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
90 call WaitForAssert({-> assert_equal('cmd: -helx', term_getline(buf, 1))})
14029
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
91
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
92 call term_sendkeys(buf, "\<C-U>exit\<CR>")
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
93 call WaitForAssert({-> assert_equal('other buffer', term_getline(buf, 1))})
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
94
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
95 call StopVimInTerminal(buf)
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
96 call delete(scriptName)
d9fc15c833d5 patch 8.1.0032: BS in prompt buffer starts new line
Christian Brabandt <cb@256bit.org>
parents: 14025
diff changeset
97 endfunc
17151
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
98
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
99 func Test_prompt_garbage_collect()
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
100 func MyPromptCallback(x, text)
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
101 " NOP
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
102 endfunc
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
103 func MyPromptInterrupt(x)
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
104 " NOP
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
105 endfunc
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
106
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
107 new
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
108 set buftype=prompt
17976
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
109 eval bufnr('')->prompt_setcallback(function('MyPromptCallback', [{}]))
6d11a0d5751d patch 8.1.1984: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17151
diff changeset
110 eval bufnr('')->prompt_setinterrupt(function('MyPromptInterrupt', [{}]))
17151
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
111 call test_garbagecollect_now()
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
112 " Must not crash
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
113 call feedkeys("\<CR>\<C-C>", 'xt')
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
114 call assert_true(v:true)
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
115
19852
12518b40c161 patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
116 call assert_fails("call prompt_setcallback(bufnr(), [])", 'E921:')
12518b40c161 patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
117 call assert_equal(0, prompt_setcallback({}, ''))
12518b40c161 patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
118 call assert_fails("call prompt_setinterrupt(bufnr(), [])", 'E921:')
12518b40c161 patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
119 call assert_equal(0, prompt_setinterrupt({}, ''))
12518b40c161 patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
120
17151
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
121 delfunc MyPromptCallback
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
122 bwipe!
ebe9aab81898 patch 8.1.1575: callbacks may be garbage collected
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
123 endfunc
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
124
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
125 " Test for editing the prompt buffer
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
126 func Test_prompt_buffer_edit()
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
127 new
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
128 set buftype=prompt
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
129 normal! i
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
130 call assert_beeps('normal! dd')
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
131 call assert_beeps('normal! ~')
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
132 call assert_beeps('normal! o')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
133 call assert_beeps('normal! O')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
134 call assert_beeps('normal! p')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
135 call assert_beeps('normal! P')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
136 call assert_beeps('normal! u')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
137 call assert_beeps('normal! ra')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
138 call assert_beeps('normal! s')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
139 call assert_beeps('normal! S')
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
140 call assert_beeps("normal! \<C-A>")
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
141 call assert_beeps("normal! \<C-X>")
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20120
diff changeset
142 " pressing CTRL-W in the prompt buffer should trigger the window commands
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20120
diff changeset
143 call assert_equal(1, winnr())
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20120
diff changeset
144 exe "normal A\<C-W>\<C-W>"
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20120
diff changeset
145 call assert_equal(2, winnr())
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20120
diff changeset
146 wincmd w
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
147 close!
20120
16460964c304 patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents: 19852
diff changeset
148 call assert_equal(0, prompt_setprompt([], ''))
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
149 endfunc
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
150
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 17976
diff changeset
151 " vim: shiftwidth=2 sts=2 expandtab