5770
|
1 Tests for :let. vim: set ft=vim ts=8 :
|
5641
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
|
5 :set runtimepath+=./sautest
|
|
6 :" Test to not autoload when assigning. It causes internal error.
|
|
7 :try
|
|
8 : let Test104#numvar = function('tr')
|
|
9 : $put ='OK: ' . string(Test104#numvar)
|
|
10 :catch
|
|
11 : $put ='FAIL: ' . v:exception
|
|
12 :endtry
|
5770
|
13 :let a = 1
|
|
14 :let b = 2
|
|
15 :for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
|
|
16 : try
|
|
17 : redir => messages
|
|
18 : execute 'let' letargs
|
|
19 : redir END
|
|
20 : $put ='OK:'
|
|
21 : $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n')
|
|
22 : catch
|
|
23 : $put ='FAIL: ' . v:exception
|
|
24 : redir END
|
|
25 : endtry
|
|
26 :endfor
|
5641
|
27 :/^Results/,$wq! test.out
|
|
28 ENDTEST
|
|
29
|
|
30 Results of test104:
|