]> git.madduck.net Git - etc/vim.git/blob - test/toc.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-markdown to short command reference
[etc/vim.git] / test / toc.vader
1 Given markdown;
2 # a
3
4 Execute (Toc does not set nomodifiable on other files):
5   " Sanity check.
6   Assert &modifiable
7
8   :Toc
9   :lclose
10   :edit a
11
12   Assert &modifiable
13
14 Given markdown;
15 header 1
16 ========
17
18 test
19
20 header 2
21 --------
22
23 test
24
25 ### header 3
26
27 test
28
29 Execute (Toc setex headers):
30   :Toc
31
32 Expect (setex headers):
33   header 1
34     header 2
35       header 3
36
37 Given markdown;
38 # header 1
39
40 test
41
42 ## header 2
43
44 test
45
46 ### header 3
47
48 test
49
50 Execute (Toc atx headers):
51   :Toc
52
53 Expect (atx headers):
54   header 1
55     header 2
56       header 3
57
58 Given markdown;
59 ATX tests.
60
61 # h1 space
62
63 #h1 nospace
64
65 #  h1 2 spaces
66
67 # h1 trailing hash #
68
69 ## h2 space
70
71 ##h2 nospace
72
73 ## h2 trailing hash ##
74
75 ### h3 space
76
77 ###h3 nospace
78
79 ### h3 trailing hash ###
80
81 #### h4
82
83 ##### h5
84
85 ###### h6
86
87 ---
88
89 Relative positions.
90
91 # h1 before h2
92
93 ## h2 between h1s
94
95 # h1 after h2
96
97 ---
98
99 Setex tests.
100
101 setex h1
102 ========
103
104 setex h2
105 --------
106
107 setex h1 single punctuation
108 =
109
110 setex h1 punctuation longer than header
111 ================================
112
113 Prevent list vs Setex confusion:
114
115 - not Setex
116 - because list
117
118 ---
119
120 Mixed tests.
121
122 setex h1 before atx
123 ===================
124
125 ## atx h2
126
127 ### atx h3
128
129 # atx h1
130
131 setex h2
132 ------------------
133
134 ### atx h3 2
135
136 Execute (Toc multiple headers):
137   :Toc
138
139 Expect (multiple headers):
140   h1 space
141   h1 nospace
142   h1 2 spaces
143   h1 trailing hash
144     h2 space
145     h2 nospace
146     h2 trailing hash
147       h3 space
148       h3 nospace
149       h3 trailing hash
150         h4
151           h5
152             h6
153   h1 before h2
154     h2 between h1s
155   h1 after h2
156   setex h1
157     setex h2
158   setex h1 single punctuation
159   setex h1 punctuation longer than header
160   setex h1 before atx
161     atx h2
162       atx h3
163   atx h1
164     setex h2
165       atx h3 2
166
167 Execute:
168   :lclose
169
170 Given markdown;
171 # header 1
172
173 ## header 2
174
175 ### header 3
176
177 Execute (Toc cursor on the current header):
178   normal! 4G
179   :Toc
180   AssertEqual line('.'), 2
181   :lclose
182   normal! G
183   :Toc
184   AssertEqual line('.'), 3
185   :lclose