Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (51 sloc) 1.249 kB
Smoke test for MzScheme interface and mzeval() function
: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))
:" newer versions:
:mz (require (prefix-in vim- 'vimext))
:mz (require r5rs)
:silent call MzRequire()
:mz (define l '("item0" "dictionary with list OK" "item2"))
:mz (define h (make-hash))
:mz (hash-set! h "list" l)
:" 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"
:let scalar_res = "FAILED"
: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"
:let res = "FAILED"
:call setline(search("^3"), "circular test " . res)
:?^1?,$w! test.out
1 line 1
2 line 2
3 line 3
Jump to Line
Something went wrong with that request. Please try again.