Mercurial > vim
comparison src/testdir/test_unlet.vim @ 7595:99e93f72ff91 v7.4.1097
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 15 20:53:38 2016 +0100
patch 7.4.1097
Problem: Looking up the alloc ID for tests fails.
Solution: Fix the line computation. Use assert_fails() for unlet test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 15 Jan 2016 21:00:07 +0100 |
parents | f73876aa9a13 |
children | 8bff367672a4 |
comparison
equal
deleted
inserted
replaced
7594:1ac8a3077973 | 7595:99e93f72ff91 |
---|---|
1 " Tests for :unlet | 1 " Tests for :unlet |
2 | 2 |
3 func Test_read_only() | 3 func Test_read_only() |
4 try | 4 " these caused a crash |
5 " this caused a crash | 5 call assert_fails('unlet count', 'E795:') |
6 unlet count | 6 call assert_fails('unlet errmsg', 'E795:') |
7 catch | |
8 call assert_true(v:exception =~ ':E795:') | |
9 endtry | |
10 try | |
11 " this caused a crash | |
12 unlet errmsg | |
13 catch | |
14 call assert_true(v:exception =~ ':E795:') | |
15 endtry | |
16 endfunc | 7 endfunc |
17 | 8 |
18 func Test_existing() | 9 func Test_existing() |
19 let does_exist = 1 | 10 let does_exist = 1 |
20 call assert_true(exists('does_exist')) | 11 call assert_true(exists('does_exist')) |
22 call assert_false(exists('does_exist')) | 13 call assert_false(exists('does_exist')) |
23 endfunc | 14 endfunc |
24 | 15 |
25 func Test_not_existing() | 16 func Test_not_existing() |
26 unlet! does_not_exist | 17 unlet! does_not_exist |
27 try | 18 call assert_fails('unlet does_not_exist', 'E108:') |
28 unlet does_not_exist | |
29 catch | |
30 call assert_true(v:exception =~ ':E108:') | |
31 endtry | |
32 endfunc | 19 endfunc |