annotate src/testdir/test_textformat.vim @ 17437:5f71f12bdb8c

Added tag v8.1.1716 for changeset e1b5c15f5fee70aaa68aa8286030cf713a403aee
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Jul 2019 23:30:05 +0200
parents 5ecac7734184
children 50c0a9fb07ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for the various 'formatoptions' settings
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 func Test_text_format()
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 setl noai tw=2 fo=t
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 \ ' ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 normal gRa b
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ 'a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ 'b'], getline(lnum - 1, lnum))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 setl ai tw=2 fo=tw
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ 'a b ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ 'a ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 normal gqgqjjllab
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 \ 'a ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ 'b ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ 'a ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ 'b'], getline(lnum - 4, lnum))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 setl tw=3 fo=t
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 \ "a \<C-A>",
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 exe "normal gqgqo\na \<C-V>\<C-A>"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ 'a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 \ "\<C-A>",
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \ 'a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \ "\<C-A>"], getline(lnum - 4, lnum))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 setl tw=2 fo=tcq1 comments=:#
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 \ 'a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 \ '#a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 exe "normal gqgqjgqgqo\na b\n#a b"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 \ 'a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 \ '#a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 \ 'a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 \ '#a b'], getline(lnum - 4, lnum))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 setl tw=5 fo=tcn comments=:#
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 \ ' 1 a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 \ '# 1 a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 exe "normal A b\<Esc>jA b"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 \ ' 1 a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 \ ' b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 \ '# 1 a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 \ '# b'], getline(lnum - 3, lnum))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 setl tw=5 fo=t2a si
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 \ ' x a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 \ ' b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 \ ' c',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 exe "normal /^{/+3\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 exe "normal i \<Esc>A_"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 \ '',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 \ ' x a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 \ ' b_',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 \ ' c',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 \ ''], getline(lnum - 2, lnum + 2))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 setl tw=5 fo=qn comments=:#
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 \ '# 1 a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 exe "normal /^{/+1\n5|"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 normal gwap
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 call assert_equal(5, col('.'))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 \ '# 1 a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 \ '# b'], getline(lnum, lnum + 1))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 setl tw=5 fo=q2 comments=:#
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 \ '# x',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 \ '# a b',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 exe "normal /^{/+1\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 normal gwap
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 \ '# x a',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 \ '# b'], getline(lnum, lnum + 1))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 setl tw& fo=a
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 \ '{',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 \ ' 1aa',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 \ ' 2bb',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 \ '}'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 exe "normal /^{/+2\n0"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 normal I^^
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 call assert_equal('{ 1aa ^^2bb }', getline('.'))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
145 setl tw=20 fo=an12wcq comments=s1:/*,mb:*,ex:*/
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
146 call append('$', [
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 \ '/* abc def ghi jkl ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148 \ ' * mno pqr stu',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
149 \ ' */'])
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150 exe "normal /mno pqr/\n"
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 normal A vwx yz
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152 let lnum = line('.')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 \ ' * mno pqr stu ',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 \ ' * vwx yz',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 \ ' */'], getline(lnum - 1, lnum + 1))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 normal ggdG
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159 setl tw=12 fo=tqnc comments=:#
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 call setline('.', '# 1 xxxxx')
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 normal A foobar
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162 call assert_equal([
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 \ '# 1 xxxxx',
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
164 \ '# foobar'], getline(1, 2))
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165
15440
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
166 " Test the 'p' flag for 'formatoptions'
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
167 " First test without the flag: that it will break "Mr. Feynman" at the space
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
168 normal ggdG
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
169 setl tw=28 fo=tcq
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
170 call setline('.', 'Surely you''re joking, Mr. Feynman!')
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
171 normal gqq
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
172 call assert_equal([
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
173 \ 'Surely you''re joking, Mr.',
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
174 \ 'Feynman!'], getline(1, 2))
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
175 " Now test with the flag: that it will push the name with the title onto the
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
176 " next line
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
177 normal ggdG
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
178 setl fo+=p
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
179 call setline('.', 'Surely you''re joking, Mr. Feynman!')
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
180 normal gqq
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
181 call assert_equal([
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
182 \ 'Surely you''re joking,',
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
183 \ 'Mr. Feynman!'], getline(1, 2))
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
184 " Ensure that it will still break if two spaces are entered
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
185 normal ggdG
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
186 call setline('.', 'Surely you''re joking, Mr. Feynman!')
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
187 normal gqq
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
188 call assert_equal([
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
189 \ 'Surely you''re joking, Mr.',
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
190 \ 'Feynman!'], getline(1, 2))
5ecac7734184 patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents: 15326
diff changeset
191
12851
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
192 setl ai& tw& fo& si& comments&
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
193 enew!
90aaa974594e patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 endfunc
13146
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
195
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
196 " Tests for :right, :center and :left on text with embedded TAB.
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
197 func Test_format_align()
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
198 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
199 set tw=65
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
200
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
201 " :left alignment
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
202 call append(0, [
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
203 \ " test for :left",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
204 \ " a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
205 \ " fa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
206 \ " dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
207 \ " sdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
208 \ " asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
209 \ " xasdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
210 \ "asxxdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
211 \ ])
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
212 %left
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
213 call assert_equal([
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
214 \ "test for :left",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
215 \ "a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
216 \ "fa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
217 \ "dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
218 \ "sdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
219 \ "asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
220 \ "xasdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
221 \ "asxxdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
222 \ ""
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
223 \ ], getline(1, '$'))
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
224 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
225
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
226 " :center alignment
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
227 call append(0, [
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
228 \ " test for :center",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
229 \ " a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
230 \ " fa afd asdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
231 \ " dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
232 \ " sdfa afd asdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
233 \ " asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
234 \ " xasdfa asdfasdfasdfasdfasdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
235 \ "asxxdfa a"
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
236 \ ])
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
237 %center
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
238 call assert_equal([
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
239 \ " test for :center",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
240 \ " a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
241 \ " fa afd asdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
242 \ " dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
243 \ " sdfa afd asdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
244 \ " asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
245 \ " xasdfa asdfasdfasdfasdfasdf",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
246 \ " asxxdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
247 \ ""
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
248 \ ], getline(1, '$'))
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
249 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
250
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
251 " :right alignment
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
252 call append(0, [
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
253 \ " test for :right",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
254 \ " a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
255 \ " fa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
256 \ " dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
257 \ " sdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
258 \ " asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
259 \ " xasdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
260 \ " asxxdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
261 \ " asxa;ofa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
262 \ " asdfaqwer a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
263 \ " a ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
264 \ " fa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
265 \ " dfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
266 \ " sdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
267 \ " asdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
268 \ " xasdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
269 \ " asxxdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
270 \ " asxa;ofa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
271 \ " asdfaqwer ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
272 \ " a axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
273 \ " fa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
274 \ " dfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
275 \ " sdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
276 \ " asdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
277 \ " xasdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
278 \ " asxxdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
279 \ " asxa;ofa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
280 \ " asdfaqwer axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
281 \ " a axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
282 \ " fa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
283 \ " dfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
284 \ " sdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
285 \ " asdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
286 \ " xasdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
287 \ " asxxdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
288 \ " asxa;ofa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
289 \ " asdfaqwer axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
290 \ " a axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
291 \ " fa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
292 \ " dfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
293 \ " sdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
294 \ " asdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
295 \ " xasdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
296 \ " asxxdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
297 \ " asxa;ofa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
298 \ " asdfaqwer axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
299 \ " a axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
300 \ " fa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
301 \ " dfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
302 \ " sdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
303 \ " asdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
304 \ " xasdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
305 \ " asxxdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
306 \ " asxa;ofa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
307 \ " asdfaqwer axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
308 \ " a axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
309 \ " fa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
310 \ " dfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
311 \ " sdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
312 \ " asdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
313 \ " xasdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
314 \ " asxxdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
315 \ " asxa;ofa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
316 \ " asdfaqwer axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
317 \ " a axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
318 \ " fa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
319 \ " dfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
320 \ " sdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
321 \ " asdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
322 \ " xasdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
323 \ " asxxdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
324 \ " asxa;ofa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
325 \ " asdfaqwer axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
326 \ " a axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
327 \ " fa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
328 \ " dfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
329 \ " sdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
330 \ " asdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
331 \ " xasdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
332 \ " asxxdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
333 \ " asxa;ofa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
334 \ " asdfaqwer axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
335 \ ])
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
336 %right
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
337 call assert_equal([
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
338 \ "\t\t\t\t test for :right",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
339 \ "\t\t\t\t a a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
340 \ "\t\t\t\t fa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
341 \ "\t\t\t\t dfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
342 \ "\t\t\t\t sdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
343 \ "\t\t\t\t asdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
344 \ "\t\t\t\t xasdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
345 \ "\t\t\t\t asxxdfa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
346 \ "\t\t\t\t asxa;ofa a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
347 \ "\t\t\t\t asdfaqwer a",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
348 \ "\t\t\t\t a ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
349 \ "\t\t\t\t fa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
350 \ "\t\t\t\t dfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
351 \ "\t\t\t\t sdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
352 \ "\t\t\t\t asdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
353 \ "\t\t\t\t xasdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
354 \ "\t\t\t\t asxxdfa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
355 \ "\t\t\t\t asxa;ofa ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
356 \ "\t\t\t\t asdfaqwer ax",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
357 \ "\t\t\t\t a axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
358 \ "\t\t\t\t fa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
359 \ "\t\t\t\t dfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
360 \ "\t\t\t\t sdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
361 \ "\t\t\t\t asdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
362 \ "\t\t\t\t xasdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
363 \ "\t\t\t\t asxxdfa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
364 \ "\t\t\t\t asxa;ofa axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
365 \ "\t\t\t\t asdfaqwer axx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
366 \ "\t\t\t\t a axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
367 \ "\t\t\t\t fa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
368 \ "\t\t\t\t dfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
369 \ "\t\t\t\t sdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
370 \ "\t\t\t\t asdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
371 \ "\t\t\t\t xasdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
372 \ "\t\t\t\t asxxdfa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
373 \ "\t\t\t\t asxa;ofa axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
374 \ "\t\t\t\t asdfaqwer axxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
375 \ "\t\t\t\t a axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
376 \ "\t\t\t\t fa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
377 \ "\t\t\t\t dfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
378 \ "\t\t\t\t sdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
379 \ "\t\t\t\t asdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
380 \ "\t\t\t\t xasdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
381 \ "\t\t\t\t asxxdfa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
382 \ "\t\t\t\t asxa;ofa axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
383 \ "\t\t\t\t asdfaqwer axxxo",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
384 \ "\t\t\t\t a axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
385 \ "\t\t\t\t fa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
386 \ "\t\t\t\t dfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
387 \ "\t\t\t\t sdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
388 \ "\t\t\t\t asdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
389 \ "\t\t\t\t xasdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
390 \ "\t\t\t\t asxxdfa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
391 \ "\t\t\t\t asxa;ofa axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
392 \ "\t\t\t\t asdfaqwer axxxoi",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
393 \ "\t\t\t\t a axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
394 \ "\t\t\t\t fa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
395 \ "\t\t\t\t dfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
396 \ "\t\t\t\t sdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
397 \ "\t\t\t\t asdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
398 \ "\t\t\t\t xasdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
399 \ "\t\t\t\t asxxdfa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
400 \ "\t\t\t\t asxa;ofa axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
401 \ "\t\t\t\t asdfaqwer axxxoik",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
402 \ "\t\t\t\t a axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
403 \ "\t\t\t\t fa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
404 \ "\t\t\t\t dfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
405 \ "\t\t\t\t sdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
406 \ "\t\t\t\t asdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
407 \ "\t\t\t\t xasdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
408 \ "\t\t\t\t asxxdfa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
409 \ "\t\t\t\t asxa;ofa axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
410 \ "\t\t\t\t asdfaqwer axxxoike",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
411 \ "\t\t\t\t a axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
412 \ "\t\t\t\t fa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
413 \ "\t\t\t\t dfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
414 \ "\t\t\t\t sdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
415 \ "\t\t\t\t asdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
416 \ "\t\t\t\t xasdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
417 \ "\t\t\t\t asxxdfa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
418 \ "\t\t\t\t asxa;ofa axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
419 \ "\t\t\t\t asdfaqwer axxxoikey",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
420 \ ""
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
421 \ ], getline(1, '$'))
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
422 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
423
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
424 set tw&
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
425 endfunc
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
426
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
427 " Test formatting a paragraph.
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
428 func Test_format_para()
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
429 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
430 set fo+=tcroql tw=72
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
431
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
432 call append(0, [
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
433 \ "xxxxx xx xxxxxx ",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
434 \ "xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
435 \ "xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
436 \ "xx xxxxxxx. xxxx xxxx.",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
437 \ "",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
438 \ "> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
439 \ "> xxxxxx xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx"
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
440 \ ])
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
441 exe "normal /xxxxxxxx$\<CR>"
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
442 normal 0gq6kk
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
443 call assert_equal([
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
444 \ "xxxxx xx xxxxxx xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
445 \ "xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx xx xxxxxxx.",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
446 \ "xxxx xxxx.",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
447 \ "",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
448 \ "> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
449 \ "> xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
450 \ ""
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
451 \ ], getline(1, '$'))
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
452
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
453 set fo& tw&
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
454 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
455 endfunc
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
456
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
457 " Test undo after ":%s" and formatting.
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
458 func Test_format_undo()
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
459 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
460 map gg :.,.+2s/^/x/<CR>kk:set tw=3<CR>gqq
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
461
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
462 call append(0, [
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
463 \ "aa aa aa aa",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
464 \ "bb bb bb bb",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
465 \ "cc cc cc cc"
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
466 \ ])
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
467 " undo/redo here to make the next undo only work on the following changes
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
468 exe "normal i\<C-G>u"
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
469 call cursor(1,1)
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
470 normal ggu
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
471 call assert_equal([
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
472 \ "aa aa aa aa",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
473 \ "bb bb bb bb",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
474 \ "cc cc cc cc",
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
475 \ ""
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
476 \ ], getline(1, '$'))
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
477
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
478 unmap gg
15326
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
479 set tw&
13146
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
480 enew!
d9a94be389b5 patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12851
diff changeset
481 endfunc
15326
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
482
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
483 func Test_format_list_auto()
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
484 new
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
485 call setline(1, ['1. abc', '2. def', '3. ghi'])
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
486 set fo=tan ai bs=2
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
487 call feedkeys("3G0lli\<BS>\<BS>x\<Esc>", 'tx')
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
488 call assert_equal('2. defx ghi', getline(2))
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
489 bwipe!
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
490 set fo& ai& bs&
fe428bee74b3 patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents: 13146
diff changeset
491 endfunc