1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: No tests for Lua.
12 Solution: Add some simple tests for Lua. (Luis Carvalho)
13 Files: src/testdir/test1.in, src/testdir/test85.in, src/testdir/test85.ok
14 src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
15 src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
16 src/testdir/Make_vms.mms, src/testdir/Makefile
19 *** ../vim-7.3.490/src/testdir/test1.in 2010-08-15 21:57:29.000000000 +0200
20 --- src/testdir/test1.in 2012-04-05 16:37:37.000000000 +0200
24 be set like small.vim above. mbyte.vim is sourced by tests that require the
26 Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
27 + Similar logic is applied to the +lua feature, using lua.vim.
30 :" Write a single line to test.out to check if testing works at all.
39 :" If +multi_byte feature supported, make mbyte.vim empty.
40 :if has("multi_byte") | sp another | w! mbyte.vim | q | endif
42 :" If +mzscheme feature supported, make mzscheme.vim empty.
43 :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
45 + :" If +lua feature supported, make lua.vim empty.
46 + :if has("lua") | sp another | w! lua.vim | q | endif
48 :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
49 :" Otherwise write small.vim to skip the test.
51 *** ../vim-7.3.490/src/testdir/test85.in 2012-04-05 16:56:12.000000000 +0200
52 --- src/testdir/test85.in 2012-04-05 16:44:00.000000000 +0200
56 + Test for Lua interface and luaeval() function
61 + :set nocompatible viminfo+=nviminfo
62 + :lua l = vim.list():add"item0":add"dictionary with list OK":add"item2"
63 + :lua h = vim.dict(); h.list = l
64 + :call garbagecollect()
66 + :" change buffer contents
67 + :lua curbuf = vim.buffer()
68 + :lua curline = vim.eval"line('.')"
69 + :lua curbuf[curline] = "1 changed line 1"
71 + :let tmp_string = luaeval('"string"')
72 + :let tmp_1000 = luaeval('1000')
73 + :if printf("%s%.0f", tmp_string, tmp_1000) == "string1000"
74 + :let scalar_res = "OK"
76 + :let scalar_res = "FAILED"
78 + :call append(search("^1"), "scalar test " . scalar_res)
79 + :" dictionary containing a list
80 + :let tmp = luaeval("h").list[1]
82 + :" circular list (at the same time test lists containing lists)
84 + :let l2 = luaeval("h").list
90 + :call setline(search("^3"), "circular test " . res)
98 *** ../vim-7.3.490/src/testdir/test85.ok 2012-04-05 16:56:12.000000000 +0200
99 --- src/testdir/test85.ok 2012-04-05 16:18:56.000000000 +0200
106 + dictionary with list OK
108 *** ../vim-7.3.490/src/testdir/Make_amiga.mak 2012-03-28 19:58:34.000000000 +0200
109 --- src/testdir/Make_amiga.mak 2012-04-05 16:21:55.000000000 +0200
113 # test25 uses symbolic link
114 # test27 can't edit file with "*"
115 # test52 only for Win32
116 + # test85 no Lua interface
118 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
119 test7.out test8.out test9.out \
120 *** ../vim-7.3.490/src/testdir/Make_dos.mak 2012-03-28 19:58:34.000000000 +0200
121 --- src/testdir/Make_dos.mak 2012-04-05 16:22:16.000000000 +0200
124 test68.out test69.out test71.out test72.out test73.out \
125 test74.out test75.out test76.out test77.out test78.out \
126 test79.out test80.out test81.out test82.out test83.out \
129 SCRIPTS32 = test50.out test70.out
132 test68.out test69.out test71.out test72.out test73.out \
133 test74.out test75.out test76.out test77.out test78.out \
134 test79.out test80.out test81.out test82.out test83.out \
135 ! test84.out test85.out
137 SCRIPTS32 = test50.out test70.out
139 *** ../vim-7.3.490/src/testdir/Make_ming.mak 2012-03-28 19:58:34.000000000 +0200
140 --- src/testdir/Make_ming.mak 2012-04-05 16:22:25.000000000 +0200
143 test68.out test69.out test71.out test72.out test73.out \
144 test74.out test75.out test76.out test77.out test78.out \
145 test79.out test80.out test81.out test82.out test83.out \
148 SCRIPTS32 = test50.out test70.out
151 test68.out test69.out test71.out test72.out test73.out \
152 test74.out test75.out test76.out test77.out test78.out \
153 test79.out test80.out test81.out test82.out test83.out \
154 ! test84.out test85.out
156 SCRIPTS32 = test50.out test70.out
158 *** ../vim-7.3.490/src/testdir/Make_os2.mak 2012-03-28 19:58:34.000000000 +0200
159 --- src/testdir/Make_os2.mak 2012-04-05 16:22:38.000000000 +0200
163 # test25 uses symbolic link
164 # test27 can't edit file with "*" in file name
165 # test52 only for Win32
166 + # test85 no Lua interface
168 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
169 test7.out test8.out test9.out \
170 *** ../vim-7.3.490/src/testdir/Make_vms.mms 2012-03-28 19:58:34.000000000 +0200
171 --- src/testdir/Make_vms.mms 2012-04-05 16:23:08.000000000 +0200
174 # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
175 # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
177 ! # Last change: 2012 Mar 28
179 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
180 # Edit the lines in the Configuration section below to select.
182 # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
183 # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
185 ! # Last change: 2012 Apr 05
187 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
188 # Edit the lines in the Configuration section below to select.
192 # with too many dots).
194 # Test 72: unknown reason
195 + # Test 85: no Lua interface
198 SCRIPT_GUI = test16.out
199 *** ../vim-7.3.490/src/testdir/Makefile 2012-03-28 19:58:34.000000000 +0200
200 --- src/testdir/Makefile 2012-04-05 16:21:13.000000000 +0200
203 test69.out test70.out test71.out test72.out test73.out \
204 test74.out test75.out test76.out test77.out test78.out \
205 test79.out test80.out test81.out test82.out test83.out \
208 SCRIPTS_GUI = test16.out
211 test69.out test70.out test71.out test72.out test73.out \
212 test74.out test75.out test76.out test77.out test78.out \
213 test79.out test80.out test81.out test82.out test83.out \
214 ! test84.out test85.out
216 SCRIPTS_GUI = test16.out
218 *** ../vim-7.3.490/src/version.c 2012-04-05 16:53:56.000000000 +0200
219 --- src/version.c 2012-04-05 16:55:27.000000000 +0200
223 { /* Add new patch number below this line */
229 You had connectors? Eeee, when I were a lad we 'ad to carry the
230 bits between the computer and the terminal with a spoon...
232 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
233 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
234 \\\ an exciting new programming language -- http://www.Zimbu.org ///
235 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///