diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-01-19 15:55:06 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-01-19 15:55:06 +0100 |
commit | 7e506b6a420588b01dbcbed9ad968b0e6d6a8785 (patch) | |
tree | 80a1e4822f8dc3fe008dc8de530966e15fd507b1 /src/testdir | |
parent | 6d8027a6c2b80318ca154ca6cde0fd930f149f03 (diff) | |
download | vim-git-7e506b6a420588b01dbcbed9ad968b0e6d6a8785.tar.gz |
updated for version 7.2.336v7.2.336
Problem: MzScheme interface can't evaluate an expression.
Solution: Add mzeval(). (Sergey Khorev)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/Make_dos.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_ming.mak | 3 | ||||
-rw-r--r-- | src/testdir/Makefile | 6 | ||||
-rw-r--r-- | src/testdir/main.aap | 4 | ||||
-rw-r--r-- | src/testdir/test1.in | 4 | ||||
-rw-r--r-- | src/testdir/test70.in | 53 | ||||
-rw-r--r-- | src/testdir/test70.ok | 5 |
7 files changed, 70 insertions, 7 deletions
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index c200a2f25..29f8b8687 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -29,7 +29,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test42.out test52.out test65.out test66.out test67.out \ test68.out test69.out -SCRIPTS32 = test50.out +SCRIPTS32 = test50.out test70.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index 26d1e8781..760bb21dd 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -48,7 +48,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test42.out test52.out test65.out test66.out test67.out \ test68.out test69.out -SCRIPTS32 = test50.out +SCRIPTS32 = test50.out test70.out SCRIPTS_GUI = test16.out @@ -78,6 +78,7 @@ clean: -$(DEL) small.vim -$(DEL) tiny.vim -$(DEL) mbyte.vim + -$(DEL) mzscheme.vim -$(DEL) X* -$(DEL) viminfo diff --git a/src/testdir/Makefile b/src/testdir/Makefile index efad475bf..073a2841d 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -23,7 +23,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test54.out test55.out test56.out test57.out test58.out \ test59.out test60.out test61.out test62.out test63.out \ test64.out test65.out test66.out test67.out test68.out \ - test69.out + test69.out test70.out SCRIPTS_GUI = test16.out @@ -44,10 +44,10 @@ report: $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) clean: - -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo + -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo test1.out: test1.in - -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo + -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in @/bin/sh -c "if diff test.out $*.ok; \ then mv -f test.out $*.out; \ diff --git a/src/testdir/main.aap b/src/testdir/main.aap index 0293b92f8..5fb93ec24 100644 --- a/src/testdir/main.aap +++ b/src/testdir/main.aap @@ -32,11 +32,11 @@ gui: newlog $Scripts $ScriptsGUI $Scripts $ScriptsGUI: $VimProg clean: - :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X* + :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* # test1 is special, it checks for features test1.out: test1.in - :del {force} test1.failed tiny.vim small.vim mbyte.vim + :del {force} test1.failed tiny.vim small.vim mbyte.vim mzscheme.vim :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in @if os.system("diff test.out test1.ok") != 0: :error test1 FAILED - Something basic is wrong diff --git a/src/testdir/test1.in b/src/testdir/test1.in index 6d1bddee9..bdcc01d08 100644 --- a/src/testdir/test1.in +++ b/src/testdir/test1.in @@ -13,6 +13,7 @@ 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 +mzscheme feature, using mzscheme.vim. STARTTEST :" Write a single line to test.out to check if testing works at all. @@ -25,8 +26,11 @@ ae! test.ok w! test.out qa! :w! mbyte.vim +:w! mzscheme.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 +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/test70.in b/src/testdir/test70.in new file mode 100644 index 000000000..01f43eafb --- /dev/null +++ b/src/testdir/test70.in @@ -0,0 +1,53 @@ +Smoke test for MzScheme interface and mzeval() function + +STARTTEST +:so mzscheme.vim +:set nocompatible viminfo+=nviminfo +:function! MzRequire() +:redir => l:mzversion +:mz (version) +:redir END +:if strpart(l:mzversion, 1, 1) < "4" +:" MzScheme versions < 4.x: +:mz (require (prefix vim- vimext)) +:else +:" newer versions: +:mz (require (prefix-in vim- 'vimext)) +:mz (require r5rs) +:endif +:endfunction +:silent call MzRequire() +:mz (define l '("item0" "dictionary with list OK" "item2")) +:mz (define h (make-hash)) +:mz (hash-set! h "list" l) +/^1 +:" change buffer contents +:mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1") +:" scalar test +:let tmp_string = mzeval('"string"') +:let tmp_1000 = mzeval('1000') +:if 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 = mzeval("h")["list"][1] +:/^2/put =tmp +:" circular list (at the same time test lists containing lists) +:mz (set-car! (cddr l) l) +:let l2 = mzeval("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/test70.ok b/src/testdir/test70.ok new file mode 100644 index 000000000..f8d2d3158 --- /dev/null +++ b/src/testdir/test70.ok @@ -0,0 +1,5 @@ +1 changed line 1 +scalar test OK +2 line 2 +dictionary with list OK +circular test OK |