]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-markdown/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:

Add '.vim/bundle/vim-flake8/' from commit 'ddceec6c457fd59bc2a9321cbf817e42aa4bfd86'
[etc/vim.git] / .vim / bundle / vim-markdown / test / map.vader
1 Given markdown;
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/markdown.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 markdown;
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/markdown.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 markdown;
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/markdown.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 markdown;
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/markdown.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 markdown;
54 [ge_test.md](ge_test.md)
55
56 Execute (ge opens file):
57   normal ge
58   AssertEqual @%, 'ge_test.md'
59   AssertEqual getline(1), 'ge test'
60
61 Given markdown;
62 [ge_test](ge_test)
63
64 Execute (ge opens file without .md extensions):
65   let g:vim_markdown_no_extensions_in_markdown = 1
66   normal ge
67   AssertEqual @%, 'ge_test.md'
68   AssertEqual getline(1), 'ge test'
69   unlet g:vim_markdown_no_extensions_in_markdown
70
71 Given markdown;
72 [ge_test.md](ge_test.md)
73
74 Execute (ge does not write before opening file):
75   normal ia
76   normal l
77   normal ge
78   AssertEqual @%, 'ge_test.md'
79   AssertEqual getline(1), 'ge test'
80
81 Given markdown;
82 [ge_test.md](ge_test.md)
83
84 Execute (ge auto-write before opening file):
85   let g:vim_markdown_autowrite = 1
86   normal ia
87   normal l
88   AssertThrows normal ge
89   AssertEqual g:vader_exception, 'Vim(write):E382: Cannot write, ''buftype'' option is set'
90   unlet g:vim_markdown_autowrite
91
92 Given markdown;
93 # a
94
95 b
96
97 # c
98
99 d
100
101 Execute (]] same level):
102   AssertEqual line('.'), 1
103   normal ]]
104   AssertEqual line('.'), 5
105   normal [[
106   AssertEqual line('.'), 1
107
108 Given markdown;
109 # a
110
111 b
112
113 ## c
114
115 d
116
117 Execute (]] different levels level):
118   AssertEqual line('.'), 1
119   normal ]]
120   AssertEqual line('.'), 5
121   normal [[
122   AssertEqual line('.'), 1
123
124 Given markdown;
125 # a
126
127 b
128
129 ## c
130
131 d
132
133 # e
134
135 f
136
137 Execute (][ different levels level):
138   AssertEqual line('.'), 1
139   normal ][
140   AssertEqual line('.'), 9
141   normal []
142   AssertEqual line('.'), 1
143
144 Given markdown;
145 # a
146
147 b
148
149 Execute (]c):
150   normal! 3G
151   AssertEqual line('.'), 3
152   normal ]c
153   AssertEqual line('.'), 1