blob: 6760700754c491406f89d21f7be17cd1bc45ac72 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001Test for user functions
2
3STARTTEST
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
23C=Table("xxx", 4, "asdf")
24 =Compute(45, 0, "retval")
25 =retval
26 =Compute(45, 5, "retval")
27 =retval
28:.wq! test.out
29ENDTEST
30
31here