Bram Moolenaar | f6f32c3 | 2016-03-12 19:03:59 +0100 | [diff] [blame] | 1 | " Test for assignment |
| 2 | |
| 3 | func Test_no_type_checking() |
| 4 | let v = 1 |
| 5 | let v = [1,2,3] |
| 6 | let v = {'a': 1, 'b': 2} |
| 7 | let v = 3.4 |
| 8 | let v = 'hello' |
| 9 | endfunc |
Bram Moolenaar | e353c40 | 2017-02-04 19:49:16 +0100 | [diff] [blame] | 10 | |
| 11 | func Test_let_termcap() |
| 12 | " Terminal code |
| 13 | let old_t_te = &t_te |
| 14 | let &t_te = "\<Esc>[yes;" |
| 15 | call assert_match('t_te.*^[[yes;', execute("set termcap")) |
| 16 | let &t_te = old_t_te |
| 17 | |
Bram Moolenaar | 1fb0d49 | 2017-02-04 21:50:19 +0100 | [diff] [blame] | 18 | if !has('gui_running') |
| 19 | " Key code |
| 20 | let old_t_k1 = &t_k1 |
| 21 | let &t_k1 = "that" |
| 22 | call assert_match('t_k1.*that', execute("set termcap")) |
| 23 | let &t_k1 = old_t_k1 |
| 24 | endif |
Bram Moolenaar | e353c40 | 2017-02-04 19:49:16 +0100 | [diff] [blame] | 25 | |
| 26 | call assert_fails('let x = &t_xx', 'E15') |
| 27 | let &t_xx = "yes" |
| 28 | call assert_equal("yes", &t_xx) |
| 29 | let &t_xx = "" |
| 30 | call assert_fails('let x = &t_xx', 'E15') |
| 31 | endfunc |