mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
legacy tests: Remove legacy tests for Lua (test85) #2357
This commit is contained in:
committed by
Michael Reed
parent
4657cd53d3
commit
0af7c8f624
1
.gitignore
vendored
1
.gitignore
vendored
@ -22,7 +22,6 @@
|
||||
# Files generated by the tests
|
||||
/src/nvim/testdir/del
|
||||
/src/nvim/testdir/mbyte.vim
|
||||
/src/nvim/testdir/lua.vim
|
||||
/src/nvim/testdir/small.vim
|
||||
/src/nvim/testdir/tiny.vim
|
||||
/src/nvim/testdir/test*.out
|
||||
|
@ -25,7 +25,7 @@ SCRIPTS := test_autoformat_join.out \
|
||||
test68.out test69.out \
|
||||
test71.out test73.out test74.out \
|
||||
test76.out test78.out test79.out test80.out \
|
||||
test82.out test83.out test85.out \
|
||||
test82.out test83.out \
|
||||
test86.out test87.out test88.out \
|
||||
test96.out test99.out \
|
||||
test_listlbr.out \
|
||||
@ -85,7 +85,7 @@ test1.out: $(VIMPROG)
|
||||
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) test1.out
|
||||
|
||||
RM_ON_RUN := test.out X* viminfo
|
||||
RM_ON_START := tiny.vim small.vim mbyte.vim lua.vim test.ok
|
||||
RM_ON_START := tiny.vim small.vim mbyte.vim test.ok
|
||||
RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(VIMPROG) -u unix.vim -U NONE -i viminfo --noplugin -s dotest.in
|
||||
|
||||
clean:
|
||||
|
@ -14,7 +14,6 @@ set like small.vim above. tiny.vim is sourced by tests that require the
|
||||
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 +lua feature, using lua.vim.
|
||||
|
||||
STARTTEST
|
||||
:" If columns or lines are too small, create wrongtermsize.
|
||||
@ -31,14 +30,10 @@ ae! test.ok
|
||||
w! test.out
|
||||
qa!
|
||||
:w! mbyte.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 +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
|
||||
|
@ -1,84 +0,0 @@
|
||||
Test for Lua interface and luaeval() function
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so lua.vim
|
||||
: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)
|
||||
|
||||
:let l = []
|
||||
:lua l = vim.eval("l")
|
||||
:lua l:add(123)
|
||||
:lua l:add("abc")
|
||||
:lua l:add(vim.eval("[1, 2, 3]"))
|
||||
:lua l:add(vim.eval("{'a':1, 'b':2, 'c':3}"))
|
||||
:lua l:insert(123)
|
||||
:lua l:insert("abc")
|
||||
:lua l:insert(vim.eval("[1, 2, 3]"))
|
||||
:lua l:insert(vim.eval("{'a':1, 'b':2, 'c':3}"))
|
||||
:lua l[0] = l[0]
|
||||
:lua l[1] = l[1]
|
||||
:lua l[2] = l[2]
|
||||
:lua l[3] = l[3]
|
||||
:lua l[0] = 123
|
||||
:lua l[1] = "abc"
|
||||
:lua l[2] = vim.eval("[1, 2, 3]")
|
||||
:lua l[3] = vim.eval("{'a':1, 'b':2, 'c':3}")
|
||||
:lua l[3] = nil
|
||||
:lua l[2] = nil
|
||||
:lua l[1] = nil
|
||||
:lua l[0] = nil
|
||||
:lua l = nil
|
||||
:$put =string(l)
|
||||
|
||||
:let d = {}
|
||||
:lua d = vim.eval("d")
|
||||
:lua d[0] = 123
|
||||
:lua d[1] = "abc"
|
||||
:lua d[2] = vim.eval("[1, 2, 3]")
|
||||
:lua d[3] = vim.eval("{'a':1, 'b':2, 'c':3}")
|
||||
:lua d[4] = d[0]
|
||||
:lua d[5] = d[1]
|
||||
:lua d[6] = d[2]
|
||||
:lua d[7] = d[3]
|
||||
:lua d[3] = nil
|
||||
:lua d[2] = nil
|
||||
:lua d[1] = nil
|
||||
:lua d[0] = nil
|
||||
:lua d = nil
|
||||
:$put =string(d)
|
||||
|
||||
:?^1?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1 line 1
|
||||
2 line 2
|
||||
3 line 3
|
@ -1,7 +0,0 @@
|
||||
1 changed line 1
|
||||
scalar test OK
|
||||
2 line 2
|
||||
dictionary with list OK
|
||||
circular test OK
|
||||
[123.0, 'abc', [1, 2, 3], {'a': 1, 'b': 2, 'c': 3}]
|
||||
{'4': 123.0, '5': 'abc', '6': [1, 2, 3], '7': {'a': 1, 'b': 2, 'c': 3}}
|
Reference in New Issue
Block a user