]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.491 v7.3.491
authorBram Moolenaar <Bram@vim.org>
Thu, 5 Apr 2012 14:56:52 +0000 (16:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 5 Apr 2012 14:56:52 +0000 (16:56 +0200)
Problem:    No tests for Lua.
Solution:   Add some simple tests for Lua. (Luis Carvalho)

src/testdir/Make_amiga.mak
src/testdir/Make_dos.mak
src/testdir/Make_ming.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
src/testdir/Makefile
src/testdir/test1.in
src/testdir/test85.in [new file with mode: 0644]
src/testdir/test85.ok [new file with mode: 0644]
src/version.c

index b01d49b85b43fef8a5c816549253f71097941fbe..a512cd9c9124130104e3a7f9f4d339b98e9384d0 100644 (file)
@@ -13,6 +13,7 @@ VIMPROG = /vim
 # test25       uses symbolic link
 # test27       can't edit file with "*"
 # test52       only for Win32
+# test85       no Lua interface
 
 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test7.out test8.out test9.out \
index d322504a80a21767340b6ff1c21140c94b747089..4498c1c81ea8e49aaf1a3440d8ee8037d8f82cc6 100644 (file)
@@ -30,7 +30,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test68.out test69.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
                test79.out test80.out test81.out test82.out test83.out \
-               test84.out
+               test84.out test85.out
 
 SCRIPTS32 =    test50.out test70.out
 
index 0a680c50037e70b626e99b71cc8dbac0ac24aca2..4aee8cdef8bddc01ac58c75d822cf818bb7041b4 100644 (file)
@@ -50,7 +50,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test68.out test69.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
                test79.out test80.out test81.out test82.out test83.out \
-               test84.out
+               test84.out test85.out
 
 SCRIPTS32 =    test50.out test70.out
 
index 9cef9aa263891e3b69c1294be2adf737267f4a98..64d853225c97075a52d16434221c99d3cb122416 100644 (file)
@@ -13,6 +13,7 @@ VIMPROG = ../vim.exe
 # test25       uses symbolic link
 # test27       can't edit file with "*" in file name
 # test52       only for Win32
+# test85       no Lua interface
 
 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test7.out test8.out test9.out \
index 4e961cff0886003ede948de311c33e72715ed753..dfc4a7b84b930115dcc8658974e8c6a930dca7d5 100644 (file)
@@ -4,7 +4,7 @@
 # Authors:     Zoltan Arpadffy, <arpadffy@polarhome.com>
 #              Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2012 Mar 28
+# Last change:  2012 Apr 05
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -89,6 +89,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 # with too many dots).
 #
 # Test 72: unknown reason
+# Test 85: no Lua interface
 
 .IFDEF WANT_GUI
 SCRIPT_GUI = test16.out
index 405ebd414868f0ac185f97ebe5dc11f6a4216b7f..0fb805175159d6830e1e7783ce6fd25d71a528dc 100644 (file)
@@ -27,7 +27,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                test69.out test70.out test71.out test72.out test73.out \
                test74.out test75.out test76.out test77.out test78.out \
                test79.out test80.out test81.out test82.out test83.out \
-               test84.out
+               test84.out test85.out
 
 SCRIPTS_GUI = test16.out
 
index a3b58418a48b791b73394372e32f9266526f4030..c175fa590e5498e8065ad55aba1f65914724f6cd 100644 (file)
@@ -15,6 +15,7 @@ If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will
 be set like small.vim above.  mbyte.vim is sourced by tests that require the
 +multi_byte feature.
 Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
+Similar logic is applied to the +lua feature, using lua.vim.
 
 STARTTEST
 :" Write a single line to test.out to check if testing works at all.
@@ -28,10 +29,17 @@ w! test.out
 qa!
 \e:w! mbyte.vim
 :w! mzscheme.vim
+:w! lua.vim
+:"
 :" If +multi_byte feature supported, make mbyte.vim empty.
 :if has("multi_byte") | sp another | w! mbyte.vim | q | endif
+:"
 :" If +mzscheme feature supported, make mzscheme.vim empty.
 :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
+:"
+:" If +lua feature supported, make lua.vim empty.
+:if has("lua") | sp another | w! lua.vim | q | endif
+:"
 :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
 :" Otherwise write small.vim to skip the test.
 :if 1 | q! | endif
diff --git a/src/testdir/test85.in b/src/testdir/test85.in
new file mode 100644 (file)
index 0000000..a4c30d0
--- /dev/null
@@ -0,0 +1,42 @@
+Test for Lua interface and luaeval() function
+
+STARTTEST
+:so small.vim
+:so lua.vim
+:set nocompatible viminfo+=nviminfo
+:lua l = vim.list():add"item0":add"dictionary with list OK":add"item2"
+:lua h = vim.dict(); h.list = l
+:call garbagecollect()
+/^1
+:" change buffer contents
+:lua curbuf = vim.buffer()
+:lua curline = vim.eval"line('.')"
+:lua curbuf[curline] = "1 changed line 1"
+:" scalar test
+:let tmp_string = luaeval('"string"')
+:let tmp_1000 = luaeval('1000')
+:if printf("%s%.0f", tmp_string, tmp_1000) == "string1000"
+:let scalar_res = "OK"
+:else
+:let scalar_res = "FAILED"
+:endif
+:call append(search("^1"), "scalar test " . scalar_res)
+:" dictionary containing a list
+:let tmp = luaeval("h").list[1]
+:/^2/put =tmp
+:" circular list (at the same time test lists containing lists)
+:lua l[2] = l
+:let l2 = luaeval("h").list
+:if l2[2] == l2
+:let res = "OK"
+:else
+:let res = "FAILED"
+:endif
+:call setline(search("^3"), "circular test " . res)
+:?^1?,$w! test.out
+:qa!
+ENDTEST
+
+1 line 1
+2 line 2
+3 line 3
diff --git a/src/testdir/test85.ok b/src/testdir/test85.ok
new file mode 100644 (file)
index 0000000..f8d2d31
--- /dev/null
@@ -0,0 +1,5 @@
+1 changed line 1
+scalar test OK
+2 line 2
+dictionary with list OK
+circular test OK
index a835ea5078c6fe9610e8f8c02fc06828b9bc4b0b..029b24024af8a57a794fe8732db7c107ebb97f5b 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    491,
 /**/
     490,
 /**/