Mercurial > vim
annotate src/testdir/test_visual.vim @ 10940:a479b7064550 v8.0.0359
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
commit https://github.com/vim/vim/commit/dc9a081712ec8c140e6d4909e9f6b03a629d32d3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 23 18:46:50 2017 +0100
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Problem: 'number' and 'relativenumber' are not properly tested.
Solution: Add tests, change old style to new style tests. (Ozaki Kiichi,
closes #1447)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Feb 2017 19:00:05 +0100 |
parents | 9b4574d95571 |
children | ae45d497868f |
rev | line source |
---|---|
10494
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
1 " Tests for various Visual mode. |
8401
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 if !has('visual') |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 finish |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 endif |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 func Test_block_shift_multibyte() |
10494
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
7 " Uses double-wide character. |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
8 if !has('multi_byte') |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
9 return |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
10 endif |
8401
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 split |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call setline(1, ['xヹxxx', 'ヹxxx']) |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 exe "normal 1G0l\<C-V>jl>" |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('x ヹxxx', getline(1)) |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal(' ヹxxx', getline(2)) |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 q! |
98955c2ffd9f
commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunc |
10494
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
18 |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
19 func Test_dotregister_paste() |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
20 new |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
21 exe "norm! ihello world\<esc>" |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
22 norm! 0ve".p |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
23 call assert_equal('hello world world', getline(1)) |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
24 q! |
1e700d72561d
commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents:
9618
diff
changeset
|
25 endfunc |
10803
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
26 |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
27 func Test_Visual_ctrl_o() |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
28 new |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
29 call setline(1, ['one', 'two', 'three']) |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
30 call cursor(1,2) |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
31 set noshowmode |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
32 set tw=0 |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
33 call feedkeys("\<c-v>jjlIa\<c-\>\<c-o>:set tw=88\<cr>\<esc>", 'tx') |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
34 call assert_equal(['oane', 'tawo', 'tahree'], getline(1, 3)) |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
35 call assert_equal(88, &tw) |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
36 set tw& |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
37 bw! |
065da86ca6d2
patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents:
10494
diff
changeset
|
38 endfu |
10881
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
39 |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
40 func Test_Visual_vapo() |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
41 new |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
42 normal oxx |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
43 normal vapo |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
44 bwipe! |
8f6df2f6d2fc
patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents:
10803
diff
changeset
|
45 endfunc |
10900
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
46 |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
47 func Test_Visual_inner_quote() |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
48 new |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
49 normal oxX |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
50 normal vki' |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
51 bwipe! |
9b4574d95571
patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents:
10881
diff
changeset
|
52 endfunc |