]> git.madduck.net Git - etc/vim.git/blob - test/map.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Update Markdown_GetUrlForPosition function b: to s:
[etc/vim.git] / test / map.vader
1 Given mkd;
2 a <http://b> c
3
4 Execute (gx autolink):
5   let b:url = 'http://b'
6   let b:line = getline(1)
7   let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition')
8   AssertEqual b:func(1, match(b:line, 'a') + 1), ''
9   AssertEqual b:func(1, match(b:line, '<') + 1), b:url
10   AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
11   AssertEqual b:func(1, match(b:line, '>') + 1), b:url
12   AssertEqual b:func(1, match(b:line, 'c') + 1), ''
13
14 Given mkd;
15 a http://b.bb c
16
17 Execute (gx implicit autolink):
18   let b:url = 'http://b.bb'
19   let b:line = getline(1)
20   let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition')
21   AssertEqual b:func(1, match(b:line, 'a') + 1), ''
22   AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
23   AssertEqual b:func(1, match(b:line, 'c') + 1), ''
24
25 Given mkd;
26 [a]: http://b "c"
27
28 Execute (gx link reference definition):
29   let b:url = 'http://b'
30   let b:line = getline(1)
31   let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition')
32   " TODO would be cool if all of the following gave the link.
33   AssertEqual b:func(1, match(b:line, 'a') + 1), ''
34   AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
35   AssertEqual b:func(1, match(b:line, 'c') + 1), ''
36
37 Given mkd;
38 a [b](c) d
39
40 Execute (gx autolink):
41   let b:url = 'c'
42   let b:line = getline(1)
43   let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition')
44   AssertEqual b:func(1, match(b:line, 'a') + 1), ''
45   AssertEqual b:func(1, match(b:line, '[') + 1), b:url
46   AssertEqual b:func(1, match(b:line, 'b') + 1), b:url
47   AssertEqual b:func(1, match(b:line, ']') + 1), b:url
48   AssertEqual b:func(1, match(b:line, '(') + 1), b:url
49   AssertEqual b:func(1, match(b:line, 'c') + 1), b:url
50   AssertEqual b:func(1, match(b:line, ')') + 1), b:url
51   AssertEqual b:func(1, match(b:line, 'd') + 1), ''
52
53 Given mkd;
54 # a
55
56 b
57
58 # c
59
60 d
61
62 Execute (]] same level):
63   AssertEqual line('.'), 1
64   normal ]]
65   AssertEqual line('.'), 5
66   normal [[
67   AssertEqual line('.'), 1
68
69 Given mkd;
70 # a
71
72 b
73
74 ## c
75
76 d
77
78 Execute (]] different levels level):
79   AssertEqual line('.'), 1
80   normal ]]
81   AssertEqual line('.'), 5
82   normal [[
83   AssertEqual line('.'), 1
84
85 Given mkd;
86 # a
87
88 b
89
90 ## c
91
92 d
93
94 # e
95
96 f
97
98 Execute (][ different levels level):
99   AssertEqual line('.'), 1
100   normal ][
101   AssertEqual line('.'), 9
102   normal []
103   AssertEqual line('.'), 1
104
105 Given mkd;
106 # a
107
108 b
109
110 Execute (]c):
111   normal! 3G
112   AssertEqual line('.'), 3
113   normal ]c
114   AssertEqual line('.'), 1
115
116 Given mkd;
117 # a
118
119 Execute (Toc does not set nomodifiable on other files):
120   " Sanity check.
121   Assert &modifiable
122
123   :Toc
124   :lclose
125   :edit a
126
127   Assert &modifiable