Bram Moolenaar | af8af8b | 2016-01-04 22:05:24 +0100 | [diff] [blame] | 1 | " Tests for :unlet |
2 | |||||
3 | func Test_read_only() | ||||
4 | try | ||||
5 | " this caused a crash | ||||
6 | unlet count | ||||
7 | catch | ||||
8 | call assert_true(v:exception =~ ':E795:') | ||||
9 | endtry | ||||
10 | endfunc | ||||
11 | |||||
12 | func Test_existing() | ||||
13 | let does_exist = 1 | ||||
14 | call assert_true(exists('does_exist')) | ||||
15 | unlet does_exist | ||||
16 | call assert_false(exists('does_exist')) | ||||
17 | endfunc | ||||
18 | |||||
19 | func Test_not_existing() | ||||
20 | unlet! does_not_exist | ||||
21 | try | ||||
22 | unlet does_not_exist | ||||
23 | catch | ||||
24 | call assert_true(v:exception =~ ':E108:') | ||||
25 | endtry | ||||
26 | endfunc |