Debian Codegraph @

tests/test-releasenotes-parsing.t

raw
1 #require fuzzywuzzy
2
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
5 > releasenotes=
6 > EOF
7
8 Bullet point with a single item spanning a single line
9
10 $ hg debugparsereleasenotes - << EOF
11 > New Features
12 > ============
13 >
14 > * Bullet point item with a single line
15 > EOF
16 section: feature
17 bullet point:
18 paragraph: Bullet point item with a single line
19
20 Bullet point that spans multiple lines.
21
22 $ hg debugparsereleasenotes - << EOF
23 > New Features
24 > ============
25 >
26 > * Bullet point with a paragraph
27 > that spans multiple lines.
28 > EOF
29 section: feature
30 bullet point:
31 paragraph: Bullet point with a paragraph that spans multiple lines.
32
33 $ hg debugparsereleasenotes - << EOF
34 > New Features
35 > ============
36 >
37 > * Bullet point with a paragraph
38 > that spans multiple lines.
39 >
40 > And has an empty line between lines too.
41 > With a line cuddling that.
42 > EOF
43 section: feature
44 bullet point:
45 paragraph: Bullet point with a paragraph that spans multiple lines.
46 paragraph: And has an empty line between lines too. With a line cuddling that.
47
48 Multiple bullet points. With some entries being multiple lines.
49
50 $ hg debugparsereleasenotes - << EOF
51 > New Features
52 > ============
53 >
54 > * First bullet point. It has a single line.
55 >
56 > * Second bullet point.
57 > It consists of multiple lines.
58 >
59 > * Third bullet point. It has a single line.
60 > EOF
61 section: feature
62 bullet point:
63 paragraph: First bullet point. It has a single line.
64 bullet point:
65 paragraph: Second bullet point. It consists of multiple lines.
66 bullet point:
67 paragraph: Third bullet point. It has a single line.
68
69 Bullet point without newline between items
70
71 $ hg debugparsereleasenotes - << EOF
72 > New Features
73 > ============
74 >
75 > * First bullet point
76 > * Second bullet point
77 > And it has multiple lines
78 > * Third bullet point
79 > * Fourth bullet point
80 > EOF
81 section: feature
82 bullet point:
83 paragraph: First bullet point
84 bullet point:
85 paragraph: Second bullet point And it has multiple lines
86 bullet point:
87 paragraph: Third bullet point
88 bullet point:
89 paragraph: Fourth bullet point
90
91 Sub-section contents are read
92
93 $ hg debugparsereleasenotes - << EOF
94 > New Features
95 > ============
96 >
97 > First Feature
98 > -------------
99 >
100 > This is the first new feature that was implemented.
101 >
102 > And a second paragraph about it.
103 >
104 > Second Feature
105 > --------------
106 >
107 > This is the second new feature that was implemented.
108 >
109 > Paragraph two.
110 >
111 > Paragraph three.
112 > EOF
113 section: feature
114 subsection: First Feature
115 paragraph: This is the first new feature that was implemented.
116 paragraph: And a second paragraph about it.
117 subsection: Second Feature
118 paragraph: This is the second new feature that was implemented.
119 paragraph: Paragraph two.
120 paragraph: Paragraph three.
121
122 Multiple sections are read
123
124 $ hg debugparsereleasenotes - << EOF
125 > New Features
126 > ============
127 >
128 > * Feature 1
129 > * Feature 2
130 >
131 > Bug Fixes
132 > =========
133 >
134 > * Fix 1
135 > * Fix 2
136 > EOF
137 section: feature
138 bullet point:
139 paragraph: Feature 1
140 bullet point:
141 paragraph: Feature 2
142 section: fix
143 bullet point:
144 paragraph: Fix 1
145 bullet point:
146 paragraph: Fix 2
147
148 Mixed sub-sections and bullet list
149
150 $ hg debugparsereleasenotes - << EOF
151 > New Features
152 > ============
153 >
154 > Feature 1
155 > ---------
156 >
157 > Some words about the first feature.
158 >
159 > Feature 2
160 > ---------
161 >
162 > Some words about the second feature.
163 > That span multiple lines.
164 >
165 > Other Changes
166 > -------------
167 >
168 > * Bullet item 1
169 > * Bullet item 2
170 > EOF
171 section: feature
172 subsection: Feature 1
173 paragraph: Some words about the first feature.
174 subsection: Feature 2
175 paragraph: Some words about the second feature. That span multiple lines.
176 bullet point:
177 paragraph: Bullet item 1
178 bullet point:
179 paragraph: Bullet item 2
180
181 Warn user in case of unexpected block while parsing
182
183 $ hg init relnotes-warn
184 $ cd relnotes-warn
185 $ touch feature1
186 $ hg -q commit -A -l - << EOF
187 > commit 1
188 >
189 > .. feature::
190 >
191 > new feature added.
192 > some words about the feature.
193 > EOF
194
195 $ hg releasenote -r .
196 changeset a4251905c440: unexpected block in release notes directive feature
197 New Features
198 ============
199
200 * new feature added. some words about the feature.
201
202 $ cd ..