Bram Moolenaar | af8af8b | 2016-01-04 22:05:24 +0100 | [diff] [blame] | 1 | " Tests for :unlet |
| 2 | |
| 3 | func Test_read_only() |
Bram Moolenaar | 065ee9a | 2016-01-15 20:53:38 +0100 | [diff] [blame] | 4 | " these caused a crash |
| 5 | call assert_fails('unlet count', 'E795:') |
| 6 | call assert_fails('unlet errmsg', 'E795:') |
Bram Moolenaar | af8af8b | 2016-01-04 22:05:24 +0100 | [diff] [blame] | 7 | endfunc |
| 8 | |
| 9 | func Test_existing() |
| 10 | let does_exist = 1 |
| 11 | call assert_true(exists('does_exist')) |
| 12 | unlet does_exist |
| 13 | call assert_false(exists('does_exist')) |
| 14 | endfunc |
| 15 | |
| 16 | func Test_not_existing() |
| 17 | unlet! does_not_exist |
Bram Moolenaar | 065ee9a | 2016-01-15 20:53:38 +0100 | [diff] [blame] | 18 | call assert_fails('unlet does_not_exist', 'E108:') |
Bram Moolenaar | af8af8b | 2016-01-04 22:05:24 +0100 | [diff] [blame] | 19 | endfunc |