annotate src/testdir/test70.in @ 17325:259134f36546

Added tag v8.1.1661 for changeset 066d77831630b47b848cf55eae03ba93b1d50aa9
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Jul 2019 22:30:05 +0200
parents cdaa688e3ddd
children 0cdb6ac20748
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2050
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
1 Smoke test for MzScheme interface and mzeval() function
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
2
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
3 STARTTEST
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
4 :so mzscheme.vim
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
5 :set nocompatible viminfo+=nviminfo
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
6 :function! MzRequire()
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
7 :redir => l:mzversion
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
8 :mz (version)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
9 :redir END
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
10 :if strpart(l:mzversion, 1, 1) < "4"
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
11 :" MzScheme versions < 4.x:
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
12 :mz (require (prefix vim- vimext))
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
13 :else
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
14 :" newer versions:
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
15 :mz (require (prefix-in vim- 'vimext))
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
16 :mz (require r5rs)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
17 :endif
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
18 :endfunction
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
19 :silent call MzRequire()
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
20 :mz (define l '("item0" "dictionary with list OK" "item2"))
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
21 :mz (define h (make-hash))
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
22 :mz (hash-set! h "list" l)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
23 /^1
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
24 :" change buffer contents
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
25 :mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1")
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
26 :" scalar test
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
27 :let tmp_string = mzeval('"string"')
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
28 :let tmp_1000 = mzeval('1000')
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
29 :if tmp_string . tmp_1000 == "string1000"
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
30 :let scalar_res = "OK"
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
31 :else
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
32 :let scalar_res = "FAILED"
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
33 :endif
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
34 :call append(search("^1"), "scalar test " . scalar_res)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
35 :" dictionary containing a list
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
36 :let tmp = mzeval("h")["list"][1]
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
37 :/^2/put =tmp
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
38 :" circular list (at the same time test lists containing lists)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
39 :mz (set-car! (cddr l) l)
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
40 :let l2 = mzeval("h")["list"]
4088
cdaa688e3ddd updated for version 7.3.798
Bram Moolenaar <bram@vim.org>
parents: 4074
diff changeset
41 :if l2[2] == l2
2050
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
42 :let res = "OK"
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
43 :else
4074
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
44 :let res = "FAILED: " . l2[2]
2050
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
45 :endif
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
46 :call setline(search("^3"), "circular test " . res)
4074
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
47 :" funcrefs
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
48 :mz (define vim:max (vim-eval "function('max')"))
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
49 :mz (define m (vim:max '(1 100 8)))
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
50 :let m = mzeval('m')
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
51 :if m == 100
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
52 :let fref_res = "OK"
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
53 :else
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
54 :let fref_res = "FAILED: " . m
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
55 :end
16e8a09e8ab0 updated for version 7.3.791
Bram Moolenaar <bram@vim.org>
parents: 2050
diff changeset
56 :call append(line('$'), 'funcrefs '. fref_res)
2050
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
57 :?^1?,$w! test.out
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
58 :qa!
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
59 ENDTEST
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
60
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
61 1 line 1
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
62 2 line 2
afcf9db31561 updated for version 7.2.336
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
63 3 line 3