##// END OF EJS Templates
py3: add b'' prefixes in tests/test-minirst.py...
Pulkit Goyal -
r36722:87b8fc45 default
parent child Browse files
Show More
@@ -28,7 +28,7 b' def debugformats(title, text, **kwargs):'
28 28 debugformat(text, 30, **kwargs)
29 29 debugformat(text, 'html', **kwargs)
30 30
31 paragraphs = """
31 paragraphs = b"""
32 32 This is some text in the first paragraph.
33 33
34 34 A small indented paragraph.
@@ -37,9 +37,9 b' This is some text in the first paragraph'
37 37 \n \n \nThe third and final paragraph.
38 38 """
39 39
40 debugformats('paragraphs', paragraphs)
40 debugformats(b'paragraphs', paragraphs)
41 41
42 definitions = """
42 definitions = b"""
43 43 A Term
44 44 Definition. The indented
45 45 lines make up the definition.
@@ -52,9 +52,9 b' Another Term'
52 52 Definition.
53 53 """
54 54
55 debugformats('definitions', definitions)
55 debugformats(b'definitions', definitions)
56 56
57 literals = r"""
57 literals = br"""
58 58 The fully minimized form is the most
59 59 convenient form::
60 60
@@ -76,9 +76,9 b' simply ends with space-double-colon. ::'
76 76 with '::' disappears in the final output.
77 77 """
78 78
79 debugformats('literals', literals)
79 debugformats(b'literals', literals)
80 80
81 lists = """
81 lists = b"""
82 82 - This is the first list item.
83 83
84 84 Second paragraph in the first list item.
@@ -127,9 +127,9 b' Bullet lists are also detected:'
127 127 * This is the third bullet
128 128 """
129 129
130 debugformats('lists', lists)
130 debugformats(b'lists', lists)
131 131
132 options = """
132 options = b"""
133 133 There is support for simple option lists,
134 134 but only with long options:
135 135
@@ -153,9 +153,9 b' marker after the option. It is treated a'
153 153 --foo bar baz
154 154 """
155 155
156 debugformats('options', options)
156 debugformats(b'options', options)
157 157
158 fields = """
158 fields = b"""
159 159 :a: First item.
160 160 :ab: Second item. Indentation and wrapping
161 161 is handled automatically.
@@ -166,9 +166,9 b' Next list:'
166 166 :much too large: This key is big enough to get its own line.
167 167 """
168 168
169 debugformats('fields', fields)
169 debugformats(b'fields', fields)
170 170
171 containers = """
171 containers = b"""
172 172 Normal output.
173 173
174 174 .. container:: debug
@@ -184,17 +184,17 b' Normal output.'
184 184 Debug output.
185 185 """
186 186
187 debugformats('containers (normal)', containers)
188 debugformats('containers (verbose)', containers, keep=['verbose'])
189 debugformats('containers (debug)', containers, keep=['debug'])
190 debugformats('containers (verbose debug)', containers,
187 debugformats(b'containers (normal)', containers)
188 debugformats(b'containers (verbose)', containers, keep=['verbose'])
189 debugformats(b'containers (debug)', containers, keep=['debug'])
190 debugformats(b'containers (verbose debug)', containers,
191 191 keep=['verbose', 'debug'])
192 192
193 roles = """Please see :hg:`add`."""
194 debugformats('roles', roles)
193 roles = b"""Please see :hg:`add`."""
194 debugformats(b'roles', roles)
195 195
196 196
197 sections = """
197 sections = b"""
198 198 Title
199 199 =====
200 200
@@ -207,10 +207,10 b' Subsection'
207 207 Markup: ``foo`` and :hg:`help`
208 208 ------------------------------
209 209 """
210 debugformats('sections', sections)
210 debugformats(b'sections', sections)
211 211
212 212
213 admonitions = """
213 admonitions = b"""
214 214 .. note::
215 215
216 216 This is a note
@@ -225,9 +225,9 b' admonitions = """'
225 225 This is danger
226 226 """
227 227
228 debugformats('admonitions', admonitions)
228 debugformats(b'admonitions', admonitions)
229 229
230 comments = """
230 comments = b"""
231 231 Some text.
232 232
233 233 .. A comment
@@ -241,27 +241,27 b' Some text.'
241 241 Empty comment above
242 242 """
243 243
244 debugformats('comments', comments)
244 debugformats(b'comments', comments)
245 245
246 246
247 data = [['a', 'b', 'c'],
248 ['1', '2', '3'],
249 ['foo', 'bar', 'baz this list is very very very long man']]
247 data = [[b'a', b'b', b'c'],
248 [b'1', b'2', b'3'],
249 [b'foo', b'bar', b'baz this list is very very very long man']]
250 250
251 251 rst = minirst.maketable(data, 2, True)
252 table = ''.join(rst)
252 table = b''.join(rst)
253 253
254 254 print(table)
255 255
256 debugformats('table', table)
256 debugformats(b'table', table)
257 257
258 data = [['s', 'long', 'line\ngoes on here'],
259 ['', 'xy', 'tried to fix here\n by indenting']]
258 data = [[b's', b'long', b'line\ngoes on here'],
259 [b'', b'xy', b'tried to fix here\n by indenting']]
260 260
261 261 rst = minirst.maketable(data, 1, False)
262 table = ''.join(rst)
262 table = b''.join(rst)
263 263
264 264 print(table)
265 265
266 debugformats('table+nl', table)
266 debugformats(b'table+nl', table)
267 267
General Comments 0
You need to be logged in to leave comments. Login now