##// 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 debugformat(text, 30, **kwargs)
28 debugformat(text, 30, **kwargs)
29 debugformat(text, 'html', **kwargs)
29 debugformat(text, 'html', **kwargs)
30
30
31 paragraphs = """
31 paragraphs = b"""
32 This is some text in the first paragraph.
32 This is some text in the first paragraph.
33
33
34 A small indented paragraph.
34 A small indented paragraph.
@@ -37,9 +37,9 b' This is some text in the first paragraph'
37 \n \n \nThe third and final paragraph.
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 A Term
43 A Term
44 Definition. The indented
44 Definition. The indented
45 lines make up the definition.
45 lines make up the definition.
@@ -52,9 +52,9 b' Another Term'
52 Definition.
52 Definition.
53 """
53 """
54
54
55 debugformats('definitions', definitions)
55 debugformats(b'definitions', definitions)
56
56
57 literals = r"""
57 literals = br"""
58 The fully minimized form is the most
58 The fully minimized form is the most
59 convenient form::
59 convenient form::
60
60
@@ -76,9 +76,9 b' simply ends with space-double-colon. ::'
76 with '::' disappears in the final output.
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 - This is the first list item.
82 - This is the first list item.
83
83
84 Second paragraph in the first list item.
84 Second paragraph in the first list item.
@@ -127,9 +127,9 b' Bullet lists are also detected:'
127 * This is the third bullet
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 There is support for simple option lists,
133 There is support for simple option lists,
134 but only with long options:
134 but only with long options:
135
135
@@ -153,9 +153,9 b' marker after the option. It is treated a'
153 --foo bar baz
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 :a: First item.
159 :a: First item.
160 :ab: Second item. Indentation and wrapping
160 :ab: Second item. Indentation and wrapping
161 is handled automatically.
161 is handled automatically.
@@ -166,9 +166,9 b' Next list:'
166 :much too large: This key is big enough to get its own line.
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 Normal output.
172 Normal output.
173
173
174 .. container:: debug
174 .. container:: debug
@@ -184,17 +184,17 b' Normal output.'
184 Debug output.
184 Debug output.
185 """
185 """
186
186
187 debugformats('containers (normal)', containers)
187 debugformats(b'containers (normal)', containers)
188 debugformats('containers (verbose)', containers, keep=['verbose'])
188 debugformats(b'containers (verbose)', containers, keep=['verbose'])
189 debugformats('containers (debug)', containers, keep=['debug'])
189 debugformats(b'containers (debug)', containers, keep=['debug'])
190 debugformats('containers (verbose debug)', containers,
190 debugformats(b'containers (verbose debug)', containers,
191 keep=['verbose', 'debug'])
191 keep=['verbose', 'debug'])
192
192
193 roles = """Please see :hg:`add`."""
193 roles = b"""Please see :hg:`add`."""
194 debugformats('roles', roles)
194 debugformats(b'roles', roles)
195
195
196
196
197 sections = """
197 sections = b"""
198 Title
198 Title
199 =====
199 =====
200
200
@@ -207,10 +207,10 b' Subsection'
207 Markup: ``foo`` and :hg:`help`
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 .. note::
214 .. note::
215
215
216 This is a note
216 This is a note
@@ -225,9 +225,9 b' admonitions = """'
225 This is danger
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 Some text.
231 Some text.
232
232
233 .. A comment
233 .. A comment
@@ -241,27 +241,27 b' Some text.'
241 Empty comment above
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'],
247 data = [[b'a', b'b', b'c'],
248 ['1', '2', '3'],
248 [b'1', b'2', b'3'],
249 ['foo', 'bar', 'baz this list is very very very long man']]
249 [b'foo', b'bar', b'baz this list is very very very long man']]
250
250
251 rst = minirst.maketable(data, 2, True)
251 rst = minirst.maketable(data, 2, True)
252 table = ''.join(rst)
252 table = b''.join(rst)
253
253
254 print(table)
254 print(table)
255
255
256 debugformats('table', table)
256 debugformats(b'table', table)
257
257
258 data = [['s', 'long', 'line\ngoes on here'],
258 data = [[b's', b'long', b'line\ngoes on here'],
259 ['', 'xy', 'tried to fix here\n by indenting']]
259 [b'', b'xy', b'tried to fix here\n by indenting']]
260
260
261 rst = minirst.maketable(data, 1, False)
261 rst = minirst.maketable(data, 1, False)
262 table = ''.join(rst)
262 table = b''.join(rst)
263
263
264 print(table)
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