Mercurial > vim
annotate src/testdir/test_history.vim @ 23782:82a8abc75070 v8.2.2432
patch 8.2.2432: libvterm tests are executed even when libtool doesn't work
Commit: https://github.com/vim/vim/commit/76ab5446d530a1c81ead0ee42cb55b4a4d515bad
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 30 20:35:28 2021 +0100
patch 8.2.2432: libvterm tests are executed even when libtool doesn't work
Problem: Libvterm tests are executed even when libtool doesn't work.
Solution: Only run libvterm tests if /usr/bin/gcc exists.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Jan 2021 20:45:04 +0100 |
parents | 595ea7f099cd |
children | 7dbd3a65a04b |
rev | line source |
---|---|
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the history functions |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
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 cmdline_hist |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 set history=7 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 function History_Tests(hist) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 " First clear the history |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call histadd(a:hist, 'dummy') |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_true(histdel(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal(-1, histnr(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal('', histget(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
17914
af3d441845cd
patch 8.1.1953: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
15 call assert_true('ls'->histadd(a:hist)) |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call assert_true(histadd(a:hist, 'buffers')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal('buffers', histget(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal('ls', histget(a:hist, -2)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal('ls', histget(a:hist, 1)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call assert_equal('', histget(a:hist, 5)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call assert_equal('', histget(a:hist, -5)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal(2, histnr(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call assert_true(histdel(a:hist, 2)) |
17914
af3d441845cd
patch 8.1.1953: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
24 call assert_false(a:hist->histdel(7)) |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal(1, histnr(a:hist)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 call assert_equal('ls', histget(a:hist, -1)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_true(histadd(a:hist, 'buffers')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_true(histadd(a:hist, 'ls')) |
17914
af3d441845cd
patch 8.1.1953: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
30 call assert_equal('ls', a:hist->histget(-1)) |
af3d441845cd
patch 8.1.1953: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
31 call assert_equal(4, a:hist->histnr()) |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 |
10434
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
33 let a=execute('history ' . a:hist) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
34 call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
35 let a=execute('history all') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
36 call assert_match("^\n # .* history\n 3 buffers\n> 4 ls", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
37 |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
38 if len(a:hist) > 0 |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
39 let a=execute('history ' . a:hist . ' 2') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
40 call assert_match("^\n # \\S* history$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
41 let a=execute('history ' . a:hist . ' 3') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
42 call assert_match("^\n # \\S* history\n 3 buffers$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
43 let a=execute('history ' . a:hist . ' 4') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
44 call assert_match("^\n # \\S* history\n> 4 ls$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
45 let a=execute('history ' . a:hist . ' 3,4') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
46 call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
47 let a=execute('history ' . a:hist . ' -1') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
48 call assert_match("^\n # \\S* history\n> 4 ls$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
49 let a=execute('history ' . a:hist . ' -2') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
50 call assert_match("^\n # \\S* history\n 3 buffers$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
51 let a=execute('history ' . a:hist . ' -2,') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
52 call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
53 let a=execute('history ' . a:hist . ' -3') |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
54 call assert_match("^\n # \\S* history$", a) |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
55 endif |
f3bb76ec4155
commit https://github.com/vim/vim/commit/eebd84eb94ed7f59a06a52cb4863563642f58899
Christian Brabandt <cb@256bit.org>
parents:
8406
diff
changeset
|
56 |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 " Test for removing entries matching a pattern |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 for i in range(1, 3) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 call histadd(a:hist, 'text_' . i) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endfor |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call assert_true(histdel(a:hist, 'text_\d\+')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 call assert_equal('ls', histget(a:hist, -1)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 " Test for freeing the entire history list |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 for i in range(1, 7) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 call histadd(a:hist, 'text_' . i) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 endfor |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 call histdel(a:hist) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 for i in range(1, 7) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call assert_equal('', histget(a:hist, i)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 call assert_equal('', histget(a:hist, i - 7 - 1)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 endfor |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
73 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
74 " Test for freeing an entry at the beginning of the history list |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
75 for i in range(1, 4) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
76 call histadd(a:hist, 'text_' . i) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
77 endfor |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
78 call histdel(a:hist, 1) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
79 call assert_equal('', histget(a:hist, 1)) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
80 call assert_equal('text_4', histget(a:hist, 4)) |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 endfunction |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 function Test_History() |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 for h in ['cmd', ':', '', 'search', '/', '?', 'expr', '=', 'input', '@', 'debug', '>'] |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call History_Tests(h) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 endfor |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 " Negative tests |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 call assert_false(histdel('abc')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 call assert_equal('', histget('abc')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 call assert_fails('call histdel([])', 'E730:') |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call assert_equal('', histget(10)) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 call assert_fails('call histget([])', 'E730:') |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 call assert_equal(-1, histnr('abc')) |
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 call assert_fails('call histnr([])', 'E730:') |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
96 call assert_fails('history xyz', 'E488:') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
97 call assert_fails('history ,abc', 'E488:') |
22375
595ea7f099cd
patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
98 call assert_fails('call histdel(":", "\\%(")', 'E53:') |
8406
5d926807c19c
commit https://github.com/vim/vim/commit/119d4693e06e68d4f099aa7287e375ae3d265fd0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 endfunction |
10565
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
100 |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
101 function Test_Search_history_window() |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
102 new |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
103 call setline(1, ['a', 'b', 'a', 'b']) |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
104 1 |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
105 call feedkeys("/a\<CR>", 'xt') |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
106 call assert_equal('a', getline('.')) |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
107 1 |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
108 call feedkeys("/b\<CR>", 'xt') |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
109 call assert_equal('b', getline('.')) |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
110 1 |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
111 " select the previous /a command |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
112 call feedkeys("q/kk\<CR>", 'x!') |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
113 call assert_equal('a', getline('.')) |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
114 call assert_equal('a', @/) |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
115 bwipe! |
ea0dadb041c9
patch 8.0.0172: command line window does not work
Christian Brabandt <cb@256bit.org>
parents:
10434
diff
changeset
|
116 endfunc |
15097
1946487c74ba
patch 8.1.0559: command line completion not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
10565
diff
changeset
|
117 |
19570
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
118 " Test for :history command option completion |
15097
1946487c74ba
patch 8.1.0559: command line completion not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
10565
diff
changeset
|
119 function Test_history_completion() |
1946487c74ba
patch 8.1.0559: command line completion not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
10565
diff
changeset
|
120 call feedkeys(":history \<C-A>\<C-B>\"\<CR>", 'tx') |
1946487c74ba
patch 8.1.0559: command line completion not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
10565
diff
changeset
|
121 call assert_equal('"history / : = > ? @ all cmd debug expr input search', @:) |
1946487c74ba
patch 8.1.0559: command line completion not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
10565
diff
changeset
|
122 endfunc |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
123 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
124 " Test for increasing the 'history' option value |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
125 func Test_history_size() |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
126 let save_histsz = &history |
19570
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
127 set history=10 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
128 call histadd(':', 'ls') |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
129 call histdel(':') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
130 for i in range(1, 5) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
131 call histadd(':', 'cmd' .. i) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
132 endfor |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
133 call assert_equal(5, histnr(':')) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
134 call assert_equal('cmd5', histget(':', -1)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
135 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
136 set history=15 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
137 for i in range(6, 10) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
138 call histadd(':', 'cmd' .. i) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
139 endfor |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
140 call assert_equal(10, histnr(':')) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
141 call assert_equal('cmd1', histget(':', 1)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
142 call assert_equal('cmd10', histget(':', -1)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
143 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
144 set history=5 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
145 call histadd(':', 'abc') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
146 call assert_equal('', histget(':', 6)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
147 call assert_equal('', histget(':', 12)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
148 call assert_equal('cmd7', histget(':', 7)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
149 call assert_equal('abc', histget(':', -1)) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
150 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
151 " This test works only when the language is English |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
152 if v:lang == "C" || v:lang =~ '^[Ee]n' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
153 set history=0 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
154 redir => v |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
155 call feedkeys(":history\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
156 redir END |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
157 call assert_equal(["'history' option is zero"], split(v, "\n")) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
158 endif |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
159 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
160 let &history=save_histsz |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
161 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
162 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
163 " Test for recalling old search patterns in / |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
164 func Test_history_search() |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
165 call histdel('/') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
166 let g:pat = [] |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
167 func SavePat() |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
168 call add(g:pat, getcmdline()) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
169 return '' |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
170 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
171 cnoremap <F2> <C-\>eSavePat()<CR> |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
172 call histadd('/', 'pat1') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
173 call histadd('/', 'pat2') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
174 let @/ = '' |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
175 call feedkeys("/\<Up>\<F2>\<Up>\<F2>\<Down>\<Down>\<F2>\<Esc>", 'xt') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
176 call assert_equal(['pat2', 'pat1', ''], g:pat) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
177 cunmap <F2> |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
178 delfunc SavePat |
19570
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
179 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
180 " Search for a pattern that is not present in the history |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
181 call assert_beeps('call feedkeys("/a1b2\<Up>\<CR>", "xt")') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
182 |
19570
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
183 " Recall patterns with 'history' set to 0 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
184 set history=0 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
185 let @/ = 'abc' |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
186 let cmd = 'call feedkeys("/\<Up>\<Down>\<S-Up>\<S-Down>\<CR>", "xt")' |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
187 call assert_fails(cmd, 'E486:') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
188 set history& |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
189 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
190 " Recall patterns till the end of history |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
191 set history=4 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
192 call histadd('/', 'pat') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
193 call histdel('/') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
194 call histadd('/', 'pat1') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
195 call histadd('/', 'pat2') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
196 call assert_beeps('call feedkeys("/\<Up>\<Up>\<Up>\<C-U>\<cr>", "xt")') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
197 call assert_beeps('call feedkeys("/\<Down><cr>", "xt")') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
198 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
199 " Test for wrapping around the history list |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
200 for i in range(3, 7) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
201 call histadd('/', 'pat' .. i) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
202 endfor |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
203 let upcmd = "\<up>\<up>\<up>\<up>\<up>" |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
204 let downcmd = "\<down>\<down>\<down>\<down>\<down>" |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
205 try |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
206 call feedkeys("/" .. upcmd .. "\<cr>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
207 catch /E486:/ |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
208 endtry |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
209 call assert_equal('pat4', @/) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
210 try |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
211 call feedkeys("/" .. upcmd .. downcmd .. "\<cr>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
212 catch /E486:/ |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
213 endtry |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
214 call assert_equal('pat4', @/) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
215 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
216 " Test for changing the search command separator in the history |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
217 call assert_fails('call feedkeys("/def/\<cr>", "xt")', 'E486:') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
218 call assert_fails('call feedkeys("?\<up>\<cr>", "xt")', 'E486:') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
219 call assert_equal('def?', histget('/', -1)) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
220 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
221 call assert_fails('call feedkeys("/ghi?\<cr>", "xt")', 'E486:') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
222 call assert_fails('call feedkeys("?\<up>\<cr>", "xt")', 'E486:') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
223 call assert_equal('ghi\?', histget('/', -1)) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
224 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
225 set history& |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
226 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
227 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
228 " Test for making sure the key value is not stored in history |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
229 func Test_history_crypt_key() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
230 CheckFeature cryptv |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
231 call feedkeys(":set bs=2 key=abc ts=8\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
232 call assert_equal('set bs=2 key= ts=8', histget(':')) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
233 set key& bs& ts& |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
234 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
235 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
236 " vim: shiftwidth=2 sts=2 expandtab |