blob: fd847131e90c26a1ebc9841d33dc8477108dbefa [file] [log] [blame]
Bram Moolenaara3920382014-03-30 16:49:09 +02001Tests for :let. vim: set ft=vim ts=8 :
Bram Moolenaar4f943c02014-02-05 22:26:05 +01002
3STARTTEST
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
Bram Moolenaara3920382014-03-30 16:49:09 +020013: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
Bram Moolenaar4f943c02014-02-05 22:26:05 +010027:/^Results/,$wq! test.out
28ENDTEST
29
30Results of test104: