Mercurial > vim
comparison src/testdir/test_ex_mode.vim @ 19289:2f0f308c069c v8.2.0203
patch 8.2.0203: :helptags and some other functionality not tested
Commit: https://github.com/vim/vim/commit/e20b9ececa37a81c0340a78f61e57fa1bf46b06d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 3 21:40:04 2020 +0100
patch 8.2.0203: :helptags and some other functionality not tested
Problem: :helptags and some other functionality not tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5567)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 Feb 2020 21:45:03 +0100 |
parents | a18d7782b80f |
children | 02111977dd05 |
comparison
equal
deleted
inserted
replaced
19288:f061872089a9 | 19289:2f0f308c069c |
---|---|
1 " Test editing line in Ex mode (see :help Q and :help gQ). | 1 " Test editing line in Ex mode (see :help Q and :help gQ). |
2 | |
3 source check.vim | |
2 | 4 |
3 " Helper function to test editing line in Q Ex mode | 5 " Helper function to test editing line in Q Ex mode |
4 func Ex_Q(cmd) | 6 func Ex_Q(cmd) |
5 " Is there a simpler way to test editing Ex line? | 7 " Is there a simpler way to test editing Ex line? |
6 call feedkeys("Q" | 8 call feedkeys("Q" |
50 endfor | 52 endfor |
51 | 53 |
52 set sw& | 54 set sw& |
53 let &encoding = encoding_save | 55 let &encoding = encoding_save |
54 endfunc | 56 endfunc |
57 | |
58 " Test subsittute confirmation prompt :%s/pat/str/c in Ex mode | |
59 func Test_Ex_substitute() | |
60 CheckRunVimInTerminal | |
61 let buf = RunVimInTerminal('', {'rows': 6}) | |
62 | |
63 call term_sendkeys(buf, ":call setline(1, ['foo foo', 'foo foo', 'foo foo'])\<CR>") | |
64 call term_sendkeys(buf, ":set number\<CR>") | |
65 call term_sendkeys(buf, "gQ") | |
66 call WaitForAssert({-> assert_match(':', term_getline(buf, 6))}, 1000) | |
67 | |
68 call term_sendkeys(buf, "%s/foo/bar/gc\<CR>") | |
69 call WaitForAssert({-> assert_match(' 1 foo foo', term_getline(buf, 5))}, | |
70 \ 1000) | |
71 call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, 1000) | |
72 call term_sendkeys(buf, "n\<CR>") | |
73 call WaitForAssert({-> assert_match(' ^^^', term_getline(buf, 6))}, | |
74 \ 1000) | |
75 call term_sendkeys(buf, "y\<CR>") | |
76 | |
77 call term_sendkeys(buf, "q\<CR>") | |
78 call WaitForAssert({-> assert_match(':', term_getline(buf, 6))}, 1000) | |
79 | |
80 call term_sendkeys(buf, ":vi\<CR>") | |
81 call WaitForAssert({-> assert_match('foo bar', term_getline(buf, 1))}, 1000) | |
82 | |
83 call term_sendkeys(buf, ":q!\n") | |
84 call StopVimInTerminal(buf) | |
85 endfunc | |
86 | |
87 " vim: shiftwidth=2 sts=2 expandtab |