annotate src/testdir/test_goto.vim @ 20525:42e5347ff9b6

Added tag v8.2.0816 for changeset bed30e6b5a095706cba0ca717d52588156c2b391
author Bram Moolenaar <Bram@vim.org>
date Sun, 24 May 2020 17:30:04 +0200
parents a4bd28e2cf1d
children 1503ecd54f8a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8925
f0d7dfb136bc commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test commands that jump somewhere.
f0d7dfb136bc commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
3 " Create a new buffer using "lines" and place the cursor on the word after the
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
4 " first occurrence of return and invoke "cmd". The cursor should now be
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
5 " positioned at the given line and col.
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
6 func XTest_goto_decl(cmd, lines, line, col)
8925
f0d7dfb136bc commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 new
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
8 call setline(1, a:lines)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
9 /return/
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
10 normal! W
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
11 execute 'norm! ' . a:cmd
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
12 call assert_equal(a:line, line('.'))
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
13 call assert_equal(a:col, col('.'))
8925
f0d7dfb136bc commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 quit!
f0d7dfb136bc commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunc
9315
1b4946fa3777 commit https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
Christian Brabandt <cb@256bit.org>
parents: 8925
diff changeset
16
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
17 func Test_gD()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
18 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
19 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
20
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
21 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
22 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
23 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
24 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
25 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
26
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
27 call XTest_goto_decl('gD', lines, 1, 5)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
28 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
29
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
30 func Test_gD_too()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
31 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
32 Filename x;
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
33
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
34 int Filename
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
35 int func() {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
36 Filename x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
37 return x;
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
38 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
39
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
40 call XTest_goto_decl('gD', lines, 1, 10)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
41 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
42
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
43 func Test_gD_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
44 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
45 /* int x; */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
46 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
47
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
48 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
49 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
50 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
51 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
52 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
53
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
54 call XTest_goto_decl('gD', lines, 2, 5)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
55 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
56
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
57 func Test_gD_inline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
58 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
59 int y /* , x */;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
60 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
61
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
62 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
63 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
64 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
65 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
66 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
67
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
68 call XTest_goto_decl('gD', lines, 2, 5)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
69 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
70
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
71 func Test_gD_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
72 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
73 char *s[] = "x";
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
74 int x = 1;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
75
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
76 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
77 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
78 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
79 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
80 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
81
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
82 call XTest_goto_decl('gD', lines, 2, 5)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
83 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
84
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
85 func Test_gD_string_same_line()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
86 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
87 char *s[] = "x", int x = 1;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
88
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
89 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
90 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
91 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
92 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
93 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
94
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
95 call XTest_goto_decl('gD', lines, 1, 22)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
96 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
97
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
98 func Test_gD_char()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
99 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
100 char c = 'x';
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
101 int x = 1;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
102
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
103 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
104 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
105 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
106 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
107 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
108
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
109 call XTest_goto_decl('gD', lines, 2, 5)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
110 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
111
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
112 func Test_gd()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
113 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
114 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
115
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
116 int func(int x)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
117 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
118 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
119 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
120 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
121
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
122 call XTest_goto_decl('gd', lines, 3, 14)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
123 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
124
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
125 func Test_gd_not_local()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
126 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
127 int func1(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
128 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
129 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
130 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
131
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
132 int func2(int x)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
133 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
134 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
135 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
136 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
137
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
138 call XTest_goto_decl('gd', lines, 3, 10)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
139 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
140
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
141 func Test_gd_kr_style()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
142 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
143 int func(x)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
144 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
145 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
146 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
147 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
148 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
149
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
150 call XTest_goto_decl('gd', lines, 2, 7)
9315
1b4946fa3777 commit https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
Christian Brabandt <cb@256bit.org>
parents: 8925
diff changeset
151 endfunc
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
152
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
153 func Test_gd_missing_braces()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
154 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
155 def func1(a)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
156 a + 1
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
157 end
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
158
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
159 a = 1
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
160
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
161 def func2()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
162 return a
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
163 end
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
164 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
165
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
166 call XTest_goto_decl('gd', lines, 1, 11)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
167 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
168
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
169 func Test_gd_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
170 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
171 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
172 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
173 /* int x; */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
174 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
175 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
176 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
177 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
178
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
179 call XTest_goto_decl('gd', lines, 4, 7)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
180 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
181
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
182 func Test_gd_comment_in_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
183 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
184 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
185 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
186 char *s ="//"; int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
187 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
188 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
189 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
190 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
191
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
192 call XTest_goto_decl('gd', lines, 3, 22)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
193 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
194
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
195 func Test_gd_string_in_comment()
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
196 set comments=
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
197 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
198 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
199 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
200 /* " */ int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
201 int x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
202 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
203 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
204 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
205
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
206 call XTest_goto_decl('gd', lines, 3, 15)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
207 set comments&
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
208 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
209
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
210 func Test_gd_inline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
211 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
212 int func(/* x is an int */ int x)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
213 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
214 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
215 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
216 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
217
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
218 call XTest_goto_decl('gd', lines, 1, 32)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
219 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
220
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
221 func Test_gd_inline_comment_only()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
222 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
223 int func(void) /* one lonely x */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
224 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
225 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
226 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
227 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
228
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
229 call XTest_goto_decl('gd', lines, 3, 10)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
230 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
231
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
232 func Test_gd_inline_comment_body()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
233 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
234 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
235 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
236 int y /* , x */;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
237
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
238 for (/* int x = 0 */; y < 2; y++);
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
239
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
240 int x = 0;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
241
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
242 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
243 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
244 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
245
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
246 call XTest_goto_decl('gd', lines, 7, 7)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
247 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
248
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
249 func Test_gd_trailing_multiline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
250 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
251 int func(int x) /* x is an int */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
252 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
253 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
254 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
255 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
256
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
257 call XTest_goto_decl('gd', lines, 1, 14)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
258 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
259
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
260 func Test_gd_trailing_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
261 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
262 int func(int x) // x is an int
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
263 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
264 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
265 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
266 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
267
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
268 call XTest_goto_decl('gd', lines, 1, 14)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
269 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
270
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
271 func Test_gd_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
272 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
273 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
274 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
275 char *s = "x";
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
276 int x = 1;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
277
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
278 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
279 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
280 [CODE]
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
281 call XTest_goto_decl('gd', lines, 4, 7)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
282 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
283
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
284 func Test_gd_string_only()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
285 let lines =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
286 int func(void)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
287 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
288 char *s = "x";
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
289
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
290 return x;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
291 }
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
292 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
293
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
294 call XTest_goto_decl('gd', lines, 5, 10)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
295 endfunc
10456
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
296
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
297 " Check that setting 'cursorline' does not change curswant
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
298 func Test_cursorline_keep_col()
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
299 new
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
300 call setline(1, ['long long long line', 'short line'])
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
301 normal ggfi
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
302 let pos = getcurpos()
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
303 normal j
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
304 set cursorline
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
305 normal k
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
306 call assert_equal(pos, getcurpos())
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
307 bwipe!
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
308 set nocursorline
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
309 endfunc
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
310
11366
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
311 func Test_gd_local_block()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
312 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
313 int main()
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
314 {
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
315 char *a = "NOT NULL";
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
316 if(a)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
317 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
318 char *b = a;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
319 printf("%s\n", b);
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
320 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
321 else
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
322 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
323 char *b = "NULL";
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
324 return b;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
325 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
326
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
327 return 0;
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
328 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
329 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
330
11366
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
331 call XTest_goto_decl('1gd', lines, 11, 11)
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
332 endfunc
14013
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
333
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
334 func Test_motion_if_elif_else_endif()
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
335 new
20199
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
336 let lines =<< trim END
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
337 /* Test pressing % on #if, #else #elsif and #endif,
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
338 * with nested #if
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
339 */
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
340 #if FOO
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
341 /* ... */
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
342 # if BAR
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
343 /* ... */
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
344 # endif
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
345 #elif BAR
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
346 /* ... */
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
347 #else
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
348 /* ... */
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
349 #endif
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
350
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
351 #define FOO 1
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
352 END
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
353 call setline(1, lines)
14013
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
354 /#if FOO
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
355 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
356 call assert_equal([9, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
357 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
358 call assert_equal([11, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
359 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
360 call assert_equal([13, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
361 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
362 call assert_equal([4, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
363 /# if BAR
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
364 norm $%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
365 call assert_equal([8, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
366 norm $%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
367 call assert_equal([6, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
368
20199
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
369 " Test for [# and ]# command
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
370 call cursor(5, 1)
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
371 normal [#
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
372 call assert_equal([4, 1], getpos('.')[1:2])
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
373 call cursor(5, 1)
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
374 normal ]#
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
375 call assert_equal([9, 1], getpos('.')[1:2])
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
376 call cursor(10, 1)
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
377 normal [#
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
378 call assert_equal([9, 1], getpos('.')[1:2])
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
379 call cursor(10, 1)
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
380 normal ]#
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
381 call assert_equal([11, 1], getpos('.')[1:2])
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
382
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
383 " Finding a match before the first line or after the last line should fail
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
384 normal gg
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
385 call assert_beeps('normal [#')
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
386 normal G
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
387 call assert_beeps('normal ]#')
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
388
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
389 " Finding a match for a macro definition (#define) should fail
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
390 normal G
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
391 call assert_beeps('normal %')
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
392
14013
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
393 bw!
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
394 endfunc
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
395
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
396 func Test_motion_c_comment()
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
397 new
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
398 a
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
399 /*
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
400 * Test pressing % on beginning/end
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
401 * of C comments.
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
402 */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
403 /* Another comment */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
404 .
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
405 norm gg0%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
406 call assert_equal([4, 3], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
407 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
408 call assert_equal([1, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
409 norm gg0l%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
410 call assert_equal([4, 3], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
411 norm h%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
412 call assert_equal([1, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
413
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
414 norm G^
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
415 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
416 call assert_equal([5, 21], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
417 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
418 call assert_equal([5, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
419
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
420 bw!
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
421 endfunc
20199
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
422
a4bd28e2cf1d patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
423 " vim: shiftwidth=2 sts=2 expandtab