Mercurial > vim
annotate src/testdir/test_backspace_opt.vim @ 7999:92ad477c6ab3 v7.4.1294
commit https://github.com/vim/vim/commit/7280140c08799f683ef31a6c1019e283c3dc13aa
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 9 11:37:50 2016 +0100
patch 7.4.1294
Problem: job_stop() only kills the started process.
Solution: Send the signal to the process group. (Olaf Dabrunz)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 09 Feb 2016 11:45:05 +0100 |
parents | 1e47dd710211 |
children | 8818bca7a824 |
rev | line source |
---|---|
7464
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for 'backspace' settings |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 :func Exec(expr) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let str='' |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 try |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 exec a:expr |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 catch /.*/ |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 let str=v:exception |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 endtry |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 return str |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 :endfunc |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 func Test_backspace_option() |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 set backspace= |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal('', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 set backspace=indent |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal('indent', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 set backspace=eol |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal('eol', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 set backspace=start |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call assert_equal('start', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " Add the value |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 set backspace= |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 set backspace=indent |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal('indent', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 set backspace+=eol |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal('indent,eol', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 set backspace+=start |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_equal('indent,eol,start', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " Delete the value |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 set backspace-=indent |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal('eol,start', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 set backspace-=start |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call assert_equal('eol', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 set backspace-=eol |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call assert_equal('', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 " Check the error |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474')) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call assert_equal(0, match(Exec('set backspace+=def'), '.*E474')) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 " NOTE: Vim doesn't check following error... |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 "call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474')) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 " Check backwards compatibility with version 5.4 and earlier |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 set backspace=0 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 call assert_equal('0', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 set backspace=1 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 call assert_equal('1', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 set backspace=2 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 call assert_equal('2', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 call assert_false(match(Exec('set backspace=3'), '.*E474')) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 call assert_false(match(Exec('set backspace=10'), '.*E474')) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 " Cleared when 'compatible' is set |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 set compatible |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 call assert_equal('', &backspace) |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 endfunc |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
1e47dd710211
commit https://github.com/vim/vim/commit/27a82e31ee9acedb6922093b2764f7f6860b0f91
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 " vim: tabstop=2 shiftwidth=0 expandtab |