annotate src/testdir/test_unlet.vim @ 7562:f73876aa9a13 v7.4.1081

commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 16:10:17 2016 +0100 patch 7.4.1081 Problem: No test for what previously caused a crash. Solution: Add test for unletting errmsg.
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 16:15:05 +0100
parents 3fcd3d235f7b
children 99e93f72ff91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7498
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for :unlet
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_read_only()
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 try
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " this caused a crash
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 unlet count
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 catch
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call assert_true(v:exception =~ ':E795:')
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 endtry
7562
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
10 try
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
11 " this caused a crash
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
12 unlet errmsg
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
13 catch
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
14 call assert_true(v:exception =~ ':E795:')
f73876aa9a13 commit https://github.com/vim/vim/commit/254b105b755d9736ece5f7f28db92acaf3e7bf76
Christian Brabandt <cb@256bit.org>
parents: 7498
diff changeset
15 endtry
7498
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfunc
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 func Test_existing()
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 let does_exist = 1
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call assert_true(exists('does_exist'))
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 unlet does_exist
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_false(exists('does_exist'))
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 endfunc
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 func Test_not_existing()
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 unlet! does_not_exist
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 try
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 unlet does_not_exist
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 catch
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_true(v:exception =~ ':E108:')
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 endtry
3fcd3d235f7b commit https://github.com/vim/vim/commit/af8af8bfac5792fa64efbc524032d568cc7754f7
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 endfunc