comparison src/testdir/test34.in @ 7:3fc0f57ecb91 v7.0001

updated for version 7.0001
author vimboss
date Sun, 13 Jun 2004 20:20:40 +0000
parents
children 8cd729851562
comparison
equal deleted inserted replaced
6:c2daee826b8f 7:3fc0f57ecb91
1 Test for user functions
2
3 STARTTEST
4 :so small.vim
5 :function Table(title, ...)
6 : let ret = a:title
7 : let idx = 1
8 : while idx <= a:0
9 : exe "let ret = ret . a:" . idx
10 : let idx = idx + 1
11 : endwhile
12 : return ret
13 :endfunction
14 :function Compute(n1, n2, divname)
15 : if a:n2 == 0
16 : return "fail"
17 : endif
18 : exe "let g:" . a:divname . " = ". a:n1 / a:n2
19 : return "ok"
20 :endfunction
21 :let retval = "nop"
22 /^here
23 C=Table("xxx", 4, "asdf")
24 =Compute(45, 0, "retval")
25 =retval
26 =Compute(45, 5, "retval")
27 =retval
28 :.wq! test.out
29 ENDTEST
30
31 here