Mercurial > vim
annotate src/testdir/test_eval.in @ 20168:be661435893a v8.2.0639
patch 8.2.0639: MS-Windows: messages test still fails
Commit: https://github.com/vim/vim/commit/49b2fb36ca94be14b98caf86420863d9bbe81a24
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 25 17:13:56 2020 +0200
patch 8.2.0639: MS-Windows: messages test still fails
Problem: MS-Windows: messages test still fails.
Solution: Filter out the maintainer message.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Apr 2020 17:15:03 +0200 |
parents | e82996ad131f |
children |
rev | line source |
---|---|
5798 | 1 Test for various eval features. vim: set ft=vim : |
2 | |
13096
30f9a62f5f51
patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
7611
diff
changeset
|
3 NOTE: Do not add more here, use new style test test_eval_stuff.vim |
30f9a62f5f51
patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
7611
diff
changeset
|
4 |
6543 | 5 Note: system clipboard is saved, changed and restored. |
5796 | 6 |
6563 | 7 clipboard contents |
8 something else | |
9 | |
5796 | 10 STARTTEST |
11 :so small.vim | |
5798 | 12 :set encoding=latin1 |
13 :set noswapfile | |
14 :lang C | |
15 :fun AppendRegContents(reg) | |
6563 | 16 call AppendRegParts(a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1))) |
17 :endfun | |
18 :fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1) | |
19 call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, a:type, a:cont, a:strcont, a:cont1, a:strcont1)) | |
5798 | 20 endfun |
21 :command -nargs=? AR :call AppendRegContents(<q-args>) | |
22 :fun SetReg(...) | |
23 call call('setreg', a:000) | |
24 call append('$', printf('{{{2 setreg(%s)', string(a:000)[1:-2])) | |
25 call AppendRegContents(a:1) | |
26 if a:1 isnot# '=' | |
27 execute "silent normal! Go==\n==\e\"".a:1."P" | |
28 endif | |
29 endfun | |
30 :fun Test() | |
31 $put ='{{{1 Appending NL with setreg()' | |
32 call setreg('a', 'abcA2', 'c') | |
33 call setreg('b', 'abcB2', 'v') | |
34 call setreg('c', 'abcC2', 'l') | |
35 call setreg('d', 'abcD2', 'V') | |
36 call setreg('e', 'abcE2', 'b') | |
37 call setreg('f', 'abcF2', "\<C-v>") | |
38 call setreg('g', 'abcG2', 'b10') | |
39 call setreg('h', 'abcH2', "\<C-v>10") | |
40 call setreg('I', 'abcI2') | |
41 | |
42 call SetReg('A', "\n") | |
43 call SetReg('B', "\n", 'c') | |
44 call SetReg('C', "\n") | |
45 call SetReg('D', "\n", 'l') | |
46 call SetReg('E', "\n") | |
47 call SetReg('F', "\n", 'b') | |
48 | |
49 $put ='{{{1 Setting lists with setreg()' | |
50 call SetReg('a', ['abcA3'], 'c') | |
51 call SetReg('b', ['abcB3'], 'l') | |
52 call SetReg('c', ['abcC3'], 'b') | |
53 call SetReg('d', ['abcD3']) | |
5810 | 54 call SetReg('e', [1, 2, 'abc', 3]) |
55 call SetReg('f', [1, 2, 3]) | |
5798 | 56 |
57 $put ='{{{1 Appending lists with setreg()' | |
58 call SetReg('A', ['abcA3c'], 'c') | |
59 call SetReg('b', ['abcB3l'], 'la') | |
60 call SetReg('C', ['abcC3b'], 'lb') | |
61 call SetReg('D', ['abcD32']) | |
62 | |
63 call SetReg('A', ['abcA32']) | |
64 call SetReg('B', ['abcB3c'], 'c') | |
65 call SetReg('C', ['abcC3l'], 'l') | |
66 call SetReg('D', ['abcD3b'], 'b') | |
67 | |
68 $put ='{{{1 Appending lists with NL with setreg()' | |
69 call SetReg('A', ["\n", 'abcA3l2'], 'l') | |
70 call SetReg('B', ["\n", 'abcB3c2'], 'c') | |
71 call SetReg('C', ["\n", 'abcC3b2'], 'b') | |
72 call SetReg('D', ["\n", 'abcD3b50'],'b50') | |
73 | |
74 $put ='{{{1 Setting lists with NLs with setreg()' | |
75 call SetReg('a', ['abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2"]) | |
76 call SetReg('b', ['abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2"], 'c') | |
77 call SetReg('c', ['abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2"], 'l') | |
78 call SetReg('d', ['abcD4b-0', "\n", "abcD4b-2\n", "\nabcD4b-3", "abcD4b-4\nabcD4b-4-2"], 'b') | |
79 call SetReg('e', ['abcE4b10-0', "\n", "abcE4b10-2\n", "\nabcE4b10-3", "abcE4b10-4\nabcE4b10-4-2"], 'b10') | |
80 | |
81 $put ='{{{1 Search and expressions' | |
82 call SetReg('/', ['abc/']) | |
83 call SetReg('/', ["abc/\n"]) | |
84 call SetReg('=', ['"abc/"']) | |
85 call SetReg('=', ["\"abc/\n\""]) | |
6543 | 86 $put ='{{{1 System clipboard' |
6563 | 87 if has('clipboard') |
6543 | 88 " Save and restore system clipboard. |
89 " If no connection to X-Server is possible, test should succeed. | |
6571 | 90 let _clipreg = ['*', getreg('*'), getregtype('*')] |
6563 | 91 let _clipopt = &cb |
6571 | 92 let &cb='unnamed' |
13096
30f9a62f5f51
patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
7611
diff
changeset
|
93 7y |
6571 | 94 AR * |
6563 | 95 tabdo :windo :echo "hi" |
13096
30f9a62f5f51
patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
7611
diff
changeset
|
96 8y |
6571 | 97 AR * |
6563 | 98 let &cb=_clipopt |
99 call call('setreg', _clipreg) | |
100 else | |
6571 | 101 call AppendRegParts('*', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']") |
102 call AppendRegParts('*', 'V', "something else\n", "['something else']", "something else\n", "['something else']") | |
6563 | 103 endif |
5798 | 104 endfun |
5796 | 105 :" |
5798 | 106 :call Test() |
5796 | 107 :" |
5798 | 108 :delfunction SetReg |
109 :delfunction AppendRegContents | |
110 :delfunction Test | |
111 :delcommand AR | |
112 :call garbagecollect(1) | |
113 :" | |
114 :/^start:/+1,$wq! test.out | |
115 :" vim: et ts=4 isk-=\: fmr=???,??? | |
116 :call getchar() | |
5796 | 117 ENDTEST |
118 | |
5798 | 119 start: |