annotate src/testdir/test_textobjects.vim @ 16720:9c90cf08cfa8 v8.1.1362

patch 8.1.1362: code and data in tests can be hard to read commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 20 22:12:34 2019 +0200 patch 8.1.1362: code and data in tests can be hard to read Problem: Code and data in tests can be hard to read. Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 May 2019 22:15:06 +0200
parents e580c9d75443
children f38fcbf343ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for textobjects
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 if !has('textobjects')
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 finish
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 endif
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
7 func CpoM(line, useM, expected)
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 new
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 if a:useM
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 set cpoptions+=M
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 else
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 set cpoptions-=M
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 endif
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call setline(1, a:line)
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call setreg('"', '')
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 normal! ggfrmavi)y
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call assert_equal(getreg('"'), a:expected[0])
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call setreg('"', '')
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 normal! `afbmavi)y
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal(getreg('"'), a:expected[1])
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call setreg('"', '')
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 normal! `afgmavi)y
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call assert_equal(getreg('"'), a:expected[2])
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 q!
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
31 endfunc
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
33 func Test_inner_block_without_cpo_M()
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 call CpoM('(red \(blue) green)', 0, ['red \(blue', 'red \(blue', ''])
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
35 endfunc
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
36
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
37 func Test_inner_block_with_cpo_M_left_backslash()
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
38 call CpoM('(red \(blue) green)', 1, ['red \(blue) green', 'blue', 'red \(blue) green'])
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
39 endfunc
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
41 func Test_inner_block_with_cpo_M_right_backslash()
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
42 call CpoM('(red (blue\) green)', 1, ['red (blue\) green', 'blue\', 'red (blue\) green'])
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
43 endfunc
9642
8cc4dfadfd48 commit https://github.com/vim/vim/commit/00b24be454800f544676aa8850fb4378a568901e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44
11478
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
45 func Test_quote_selection_selection_exclusive()
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
46 new
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
47 call setline(1, "a 'bcde' f")
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
48 set selection=exclusive
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
49 exe "norm! fdvhi'y"
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
50 call assert_equal('bcde', @")
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
51 set selection&vim
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
52 bw!
29a781fd3f27 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
53 endfunc
12560
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
54
15930
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
55 func Test_quote_selection_selection_exclusive_abort()
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
56 new
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
57 set selection=exclusive
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
58 call setline(1, "'abzzc'")
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
59 let exp_curs = [0, 1, 6, 0]
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
60 call cursor(1,1)
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
61 exe 'norm! fcdvi"'
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
62 " make sure to end visual mode to have a clear state
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
63 exe "norm! \<esc>"
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
64 call assert_equal(exp_curs, getpos('.'))
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
65 call cursor(1,1)
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
66 exe 'norm! fcvi"'
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
67 exe "norm! \<esc>"
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
68 call assert_equal(exp_curs, getpos('.'))
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
69 call cursor(1,2)
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
70 exe 'norm! vfcoi"'
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
71 exe "norm! \<esc>"
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
72 let exp_curs = [0, 1, 2, 0]
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
73 let exp_visu = [0, 1, 7, 0]
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
74 call assert_equal(exp_curs, getpos('.'))
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
75 call assert_equal(exp_visu, getpos("'>"))
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
76 set selection&vim
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
77 bw!
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
78 endfunc
e580c9d75443 patch 8.1.0971: failure for selecting quoted text object moves cursor
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
79
12560
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
80 " Tests for string and html text objects
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
81 func Test_string_html_objects()
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
82 enew!
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
83
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
84 let t = '"wo\"rd\\" foo'
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
85 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
86 normal! da"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
87 call assert_equal('foo', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
88
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
89 let t = "'foo' 'bar' 'piep'"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
90 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
91 normal! 0va'a'rx
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
92 call assert_equal("xxxxxxxxxxxx'piep'", getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
93
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
94 let t = "bla bla `quote` blah"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
95 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
96 normal! 02f`da`
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
97 call assert_equal("bla bla blah", getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
98
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
99 let t = 'out " in "noXno"'
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
100 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
101 normal! 0fXdi"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
102 call assert_equal('out " in ""', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
103
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
104 let t = "\"'\" 'blah' rep 'buh'"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
105 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
106 normal! 03f'vi'ry
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
107 call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
108
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
109 set quoteescape=+*-
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
110 let t = "bla `s*`d-`+++`l**` b`la"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
111 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
112 normal! di`
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
113 call assert_equal("bla `` b`la", getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
114
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
115 let t = 'voo "nah" sdf " asdf" sdf " sdf" sd'
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
116 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
117 normal! $F"va"oha"i"rz
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
118 call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
119
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
120 let t = "-<b>asdf<i>Xasdf</i>asdf</b>-"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
121 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
122 normal! fXdit
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
123 call assert_equal('-<b>asdf<i></i>asdf</b>-', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
124
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
125 let t = "-<b>asdX<i>a<i />sdf</i>asdf</b>-"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
126 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
127 normal! 0fXdit
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
128 call assert_equal('-<b></b>-', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
129
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
130 let t = "-<b>asdf<i>Xasdf</i>asdf</b>-"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
131 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
132 normal! fXdat
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
133 call assert_equal('-<b>asdfasdf</b>-', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
134
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
135 let t = "-<b>asdX<i>as<b />df</i>asdf</b>-"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
136 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
137 normal! 0fXdat
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
138 call assert_equal('--', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
139
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
140 let t = "-<b>\ninnertext object\n</b>"
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
141 put =t
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
142 normal! dit
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
143 call assert_equal('-<b></b>', getline('.'))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
144
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
145 set quoteescape&
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
146 enew!
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
147 endfunc
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
148
14554
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
149 func Test_empty_html_tag()
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
150 new
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
151 call setline(1, '<div></div>')
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
152 normal 0citxxx
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
153 call assert_equal('<div>xxx</div>', getline(1))
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
154
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
155 call setline(1, '<div></div>')
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
156 normal 0f<cityyy
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
157 call assert_equal('<div>yyy</div>', getline(1))
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
158
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
159 call setline(1, '<div></div>')
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
160 normal 0f<vitsaaa
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
161 call assert_equal('aaa', getline(1))
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
162
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
163 bwipe!
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
164 endfunc
e7f92d1a3fcd patch 8.1.0290: "cit" on an empty HTML tag changes the whole tag
Christian Brabandt <cb@256bit.org>
parents: 14131
diff changeset
165
12560
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
166 " Tests for match() and matchstr()
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
167 func Test_match()
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
168 call assert_equal("b", matchstr("abcd", ".", 0, 2))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
169 call assert_equal("bc", matchstr("abcd", "..", 0, 2))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
170 call assert_equal("c", matchstr("abcd", ".", 2, 0))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
171 call assert_equal("a", matchstr("abcd", ".", 0, -1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
172 call assert_equal(-1, match("abcd", ".", 0, 5))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
173 call assert_equal(0 , match("abcd", ".", 0, -1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
174 call assert_equal(0 , match('abc', '.', 0, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
175 call assert_equal(1 , match('abc', '.', 0, 2))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
176 call assert_equal(2 , match('abc', '.', 0, 3))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
177 call assert_equal(-1, match('abc', '.', 0, 4))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
178 call assert_equal(1 , match('abc', '.', 1, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
179 call assert_equal(2 , match('abc', '.', 2, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
180 call assert_equal(-1, match('abc', '.', 3, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
181 call assert_equal(3 , match('abc', '$', 0, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
182 call assert_equal(-1, match('abc', '$', 0, 2))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
183 call assert_equal(3 , match('abc', '$', 1, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
184 call assert_equal(3 , match('abc', '$', 2, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
185 call assert_equal(3 , match('abc', '$', 3, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
186 call assert_equal(-1, match('abc', '$', 4, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
187 call assert_equal(0 , match('abc', '\zs', 0, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
188 call assert_equal(1 , match('abc', '\zs', 0, 2))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
189 call assert_equal(2 , match('abc', '\zs', 0, 3))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
190 call assert_equal(3 , match('abc', '\zs', 0, 4))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
191 call assert_equal(-1, match('abc', '\zs', 0, 5))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
192 call assert_equal(1 , match('abc', '\zs', 1, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
193 call assert_equal(2 , match('abc', '\zs', 2, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
194 call assert_equal(3 , match('abc', '\zs', 3, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
195 call assert_equal(-1, match('abc', '\zs', 4, 1))
44aa2997239d patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents: 11478
diff changeset
196 endfunc
13223
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
197
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
198 " This was causing an illegal memory access
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
199 func Test_inner_tag()
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
200 new
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
201 norm ixxx
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
202 call feedkeys("v", 'xt')
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
203 insert
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
204 x
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
205 x
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
206 .
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
207 norm it
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
208 q!
e37327129859 patch 8.0.1486: accessing invalid memory with "it"
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
209 endfunc
14131
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
210
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
211 func Test_sentence()
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
212 enew!
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
213 call setline(1, 'A sentence. A sentence? A sentence!')
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
214
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
215 normal yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
216 call assert_equal('A sentence.', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
217 normal yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
218 call assert_equal('A sentence. ', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
219
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
220 normal )
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
221
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
222 normal yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
223 call assert_equal('A sentence?', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
224 normal yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
225 call assert_equal('A sentence? ', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
226
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
227 normal )
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
228
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
229 normal yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
230 call assert_equal('A sentence!', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
231 normal yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
232 call assert_equal(' A sentence!', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
233
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
234 normal 0
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
235 normal 2yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
236 call assert_equal('A sentence. ', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
237 normal 3yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
238 call assert_equal('A sentence. A sentence?', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
239 normal 2yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
240 call assert_equal('A sentence. A sentence? ', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
241
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
242 %delete _
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
243 endfunc
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
244
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
245 func Test_sentence_with_quotes()
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
246 enew!
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
247 call setline(1, 'A "sentence." A sentence.')
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
248
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
249 normal yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
250 call assert_equal('A "sentence."', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
251 normal yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
252 call assert_equal('A "sentence." ', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
253
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
254 normal )
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
255
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
256 normal yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
257 call assert_equal('A sentence.', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
258 normal yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
259 call assert_equal(' A sentence.', @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
260
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
261 %delete _
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
262 endfunc
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
263
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14554
diff changeset
264 func Test_sentence_with_cursor_on_delimiter()
14131
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
265 enew!
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
266 call setline(1, "A '([sentence.])' A sentence.")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
267
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
268 normal! 15|yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
269 call assert_equal("A '([sentence.])'", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
270 normal! 15|yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
271 call assert_equal("A '([sentence.])' ", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
272
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
273 normal! 16|yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
274 call assert_equal("A '([sentence.])'", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
275 normal! 16|yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
276 call assert_equal("A '([sentence.])' ", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
277
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
278 normal! 17|yis
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
279 call assert_equal("A '([sentence.])'", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
280 normal! 17|yas
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
281 call assert_equal("A '([sentence.])' ", @")
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
282
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
283 %delete _
ec85acd49b8e patch 8.1.0083: "is" and "as" have trouble with quoted punctuation
Christian Brabandt <cb@256bit.org>
parents: 13223
diff changeset
284 endfunc