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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
1 Test for various eval features. vim: set ft=vim :
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
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
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
5 Note: system clipboard is saved, changed and restored.
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
7 clipboard contents
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
8 something else
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
9
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 STARTTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 :so small.vim
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
12 :set encoding=latin1
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
13 :set noswapfile
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
14 :lang C
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
15 :fun AppendRegContents(reg)
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
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)))
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
17 :endfun
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
18 :fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1)
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
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
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
20 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
21 :command -nargs=? AR :call AppendRegContents(<q-args>)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
22 :fun SetReg(...)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
23 call call('setreg', a:000)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
24 call append('$', printf('{{{2 setreg(%s)', string(a:000)[1:-2]))
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
25 call AppendRegContents(a:1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
26 if a:1 isnot# '='
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
27 execute "silent normal! Go==\n==\e\"".a:1."P"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
28 endif
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
29 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
30 :fun Test()
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
31 $put ='{{{1 Appending NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
32 call setreg('a', 'abcA2', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
33 call setreg('b', 'abcB2', 'v')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
34 call setreg('c', 'abcC2', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
35 call setreg('d', 'abcD2', 'V')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
36 call setreg('e', 'abcE2', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
37 call setreg('f', 'abcF2', "\<C-v>")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
38 call setreg('g', 'abcG2', 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
39 call setreg('h', 'abcH2', "\<C-v>10")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
40 call setreg('I', 'abcI2')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
41
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
42 call SetReg('A', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
43 call SetReg('B', "\n", 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
44 call SetReg('C', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
45 call SetReg('D', "\n", 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
46 call SetReg('E', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
47 call SetReg('F', "\n", 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
48
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
49 $put ='{{{1 Setting lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
50 call SetReg('a', ['abcA3'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
51 call SetReg('b', ['abcB3'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
52 call SetReg('c', ['abcC3'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
53 call SetReg('d', ['abcD3'])
5810
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
54 call SetReg('e', [1, 2, 'abc', 3])
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
55 call SetReg('f', [1, 2, 3])
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
56
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
57 $put ='{{{1 Appending lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
58 call SetReg('A', ['abcA3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
59 call SetReg('b', ['abcB3l'], 'la')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
60 call SetReg('C', ['abcC3b'], 'lb')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
61 call SetReg('D', ['abcD32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
62
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
63 call SetReg('A', ['abcA32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
64 call SetReg('B', ['abcB3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
65 call SetReg('C', ['abcC3l'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
66 call SetReg('D', ['abcD3b'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
67
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
68 $put ='{{{1 Appending lists with NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
69 call SetReg('A', ["\n", 'abcA3l2'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
70 call SetReg('B', ["\n", 'abcB3c2'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
71 call SetReg('C', ["\n", 'abcC3b2'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
72 call SetReg('D', ["\n", 'abcD3b50'],'b50')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
73
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
74 $put ='{{{1 Setting lists with NLs with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
75 call SetReg('a', ['abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
76 call SetReg('b', ['abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2"], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
77 call SetReg('c', ['abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2"], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
78 call SetReg('d', ['abcD4b-0', "\n", "abcD4b-2\n", "\nabcD4b-3", "abcD4b-4\nabcD4b-4-2"], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
79 call SetReg('e', ['abcE4b10-0', "\n", "abcE4b10-2\n", "\nabcE4b10-3", "abcE4b10-4\nabcE4b10-4-2"], 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
80
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
81 $put ='{{{1 Search and expressions'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
82 call SetReg('/', ['abc/'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
83 call SetReg('/', ["abc/\n"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
84 call SetReg('=', ['"abc/"'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
85 call SetReg('=', ["\"abc/\n\""])
6543
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
86 $put ='{{{1 System clipboard'
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
87 if has('clipboard')
6543
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
88 " Save and restore system clipboard.
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
89 " If no connection to X-Server is possible, test should succeed.
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
90 let _clipreg = ['*', getreg('*'), getregtype('*')]
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
91 let _clipopt = &cb
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
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
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
94 AR *
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
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
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
97 AR *
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
98 let &cb=_clipopt
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
99 call call('setreg', _clipreg)
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
100 else
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
101 call AppendRegParts('*', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
102 call AppendRegParts('*', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
103 endif
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
104 endfun
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
106 :call Test()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
108 :delfunction SetReg
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
109 :delfunction AppendRegContents
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
110 :delfunction Test
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
111 :delcommand AR
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
112 :call garbagecollect(1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
113 :"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
114 :/^start:/+1,$wq! test.out
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
115 :" vim: et ts=4 isk-=\: fmr=???,???
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
116 :call getchar()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
117 ENDTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
119 start: