Lines Matching refs:assertEqual
48 self.assertEqual(f'{y}', format(y))
49 self.assertEqual(f'{y}', 'class')
50 self.assertEqual(format(x), format(y))
55 self.assertEqual(x.__format__(''), 'class')
56 self.assertEqual(y.__format__(''), 'instance')
59 self.assertEqual(type(x).__format__(x, ''), 'class')
60 self.assertEqual(type(y).__format__(y, ''), 'class')
91 self.assertEqual(type(t), ast.Module)
92 self.assertEqual(len(t.body), 2)
94 self.assertEqual(type(t.body[0]), ast.Assign)
95 self.assertEqual(t.body[0].lineno, 2)
97 self.assertEqual(type(t.body[1]), ast.Expr)
98 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
99 self.assertEqual(len(t.body[1].value.values), 1)
100 self.assertEqual(type(t.body[1].value.values[0]), ast.FormattedValue)
101 self.assertEqual(t.body[1].lineno, 3)
102 self.assertEqual(t.body[1].value.lineno, 3)
103 self.assertEqual(t.body[1].value.values[0].lineno, 3)
106 self.assertEqual(type(binop), ast.BinOp)
107 self.assertEqual(type(binop.left), ast.Name)
108 self.assertEqual(type(binop.op), ast.Mult)
109 self.assertEqual(type(binop.right), ast.Call)
110 self.assertEqual(binop.lineno, 3)
111 self.assertEqual(binop.left.lineno, 3)
112 self.assertEqual(binop.right.lineno, 3)
113 self.assertEqual(binop.col_offset, 3)
114 self.assertEqual(binop.left.col_offset, 3)
115 self.assertEqual(binop.right.col_offset, 7)
122 self.assertEqual(type(t), ast.Module)
123 self.assertEqual(len(t.body), 2)
125 self.assertEqual(type(t.body[0]), ast.Expr)
126 self.assertEqual(type(t.body[0].value), ast.JoinedStr)
127 self.assertEqual(t.body[0].lineno, 2)
129 self.assertEqual(type(t.body[1]), ast.Expr)
130 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
131 self.assertEqual(len(t.body[1].value.values), 4)
132 self.assertEqual(type(t.body[1].value.values[0]), ast.Constant)
133 self.assertEqual(type(t.body[1].value.values[0].value), str)
134 self.assertEqual(type(t.body[1].value.values[1]), ast.FormattedValue)
135 self.assertEqual(type(t.body[1].value.values[2]), ast.Constant)
136 self.assertEqual(type(t.body[1].value.values[2].value), str)
137 self.assertEqual(type(t.body[1].value.values[3]), ast.FormattedValue)
138 self.assertEqual(t.body[1].lineno, 3)
139 self.assertEqual(t.body[1].value.lineno, 3)
140 self.assertEqual(t.body[1].value.values[0].lineno, 3)
141 self.assertEqual(t.body[1].value.values[1].lineno, 3)
142 self.assertEqual(t.body[1].value.values[2].lineno, 3)
143 self.assertEqual(t.body[1].value.values[3].lineno, 3)
146 self.assertEqual(type(binop1), ast.BinOp)
147 self.assertEqual(type(binop1.left), ast.Name)
148 self.assertEqual(type(binop1.op), ast.Mult)
149 self.assertEqual(type(binop1.right), ast.Call)
150 self.assertEqual(binop1.lineno, 3)
151 self.assertEqual(binop1.left.lineno, 3)
152 self.assertEqual(binop1.right.lineno, 3)
153 self.assertEqual(binop1.col_offset, 8)
154 self.assertEqual(binop1.left.col_offset, 8)
155 self.assertEqual(binop1.right.col_offset, 12)
158 self.assertEqual(type(binop2), ast.BinOp)
159 self.assertEqual(type(binop2.left), ast.Name)
160 self.assertEqual(type(binop2.op), ast.Add)
161 self.assertEqual(type(binop2.right), ast.Call)
162 self.assertEqual(binop2.lineno, 3)
163 self.assertEqual(binop2.left.lineno, 3)
164 self.assertEqual(binop2.right.lineno, 3)
165 self.assertEqual(binop2.col_offset, 23)
166 self.assertEqual(binop2.left.col_offset, 23)
167 self.assertEqual(binop2.right.col_offset, 27)
174 self.assertEqual(type(t), ast.Module)
175 self.assertEqual(len(t.body), 2)
177 self.assertEqual(type(t.body[0]), ast.Assign)
178 self.assertEqual(t.body[0].lineno, 2)
180 self.assertEqual(type(t.body[1]), ast.Expr)
181 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
182 self.assertEqual(len(t.body[1].value.values), 1)
183 self.assertEqual(type(t.body[1].value.values[0]), ast.FormattedValue)
184 self.assertEqual(t.body[1].lineno, 3)
185 self.assertEqual(t.body[1].value.lineno, 3)
186 self.assertEqual(t.body[1].value.values[0].lineno, 3)
189 self.assertEqual(type(binop), ast.BinOp)
190 self.assertEqual(type(binop.left), ast.Name)
191 self.assertEqual(type(binop.op), ast.Mult)
192 self.assertEqual(type(binop.right), ast.JoinedStr)
193 self.assertEqual(binop.lineno, 3)
194 self.assertEqual(binop.left.lineno, 3)
195 self.assertEqual(binop.right.lineno, 3)
196 self.assertEqual(binop.col_offset, 3)
197 self.assertEqual(binop.left.col_offset, 3)
198 self.assertEqual(binop.right.col_offset, 7)
200 self.assertEqual(len(binop.right.values), 3)
201 self.assertEqual(type(binop.right.values[0]), ast.Constant)
202 self.assertEqual(type(binop.right.values[0].value), str)
203 self.assertEqual(type(binop.right.values[1]), ast.FormattedValue)
204 self.assertEqual(type(binop.right.values[2]), ast.Constant)
205 self.assertEqual(type(binop.right.values[2].value), str)
206 self.assertEqual(binop.right.values[0].lineno, 3)
207 self.assertEqual(binop.right.values[1].lineno, 3)
208 self.assertEqual(binop.right.values[2].lineno, 3)
210 self.assertEqual(type(call), ast.Call)
211 self.assertEqual(call.lineno, 3)
212 self.assertEqual(call.col_offset, 11)
220 self.assertEqual(type(t), ast.Module)
221 self.assertEqual(len(t.body), 2)
223 self.assertEqual(type(t.body[0]), ast.Assign)
224 self.assertEqual(t.body[0].lineno, 2)
226 self.assertEqual(type(t.body[1]), ast.Expr)
227 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
228 self.assertEqual(len(t.body[1].value.values), 5)
229 self.assertEqual(type(t.body[1].value.values[0]), ast.FormattedValue)
230 self.assertEqual(type(t.body[1].value.values[1]), ast.Constant)
231 self.assertEqual(type(t.body[1].value.values[1].value), str)
232 self.assertEqual(type(t.body[1].value.values[2]), ast.FormattedValue)
233 self.assertEqual(type(t.body[1].value.values[3]), ast.Constant)
234 self.assertEqual(type(t.body[1].value.values[3].value), str)
235 self.assertEqual(type(t.body[1].value.values[4]), ast.FormattedValue)
236 self.assertEqual(t.body[1].lineno, 3)
237 self.assertEqual(t.body[1].value.lineno, 3)
238 self.assertEqual(t.body[1].value.values[0].lineno, 3)
239 self.assertEqual(t.body[1].value.values[1].lineno, 3)
240 self.assertEqual(t.body[1].value.values[2].lineno, 3)
241 self.assertEqual(t.body[1].value.values[3].lineno, 3)
242 self.assertEqual(t.body[1].value.values[4].lineno, 3)
245 self.assertEqual(type(binop), ast.BinOp)
246 self.assertEqual(type(binop.left), ast.Name)
247 self.assertEqual(type(binop.op), ast.Mult)
248 self.assertEqual(type(binop.right), ast.Call)
249 self.assertEqual(binop.lineno, 3)
250 self.assertEqual(binop.left.lineno, 3)
251 self.assertEqual(binop.right.lineno, 3)
252 self.assertEqual(binop.col_offset, 3)
253 self.assertEqual(binop.left.col_offset, 3)
254 self.assertEqual(binop.right.col_offset, 7)
257 self.assertEqual(type(binop), ast.BinOp)
258 self.assertEqual(type(binop.left), ast.Name)
259 self.assertEqual(type(binop.op), ast.Mult)
260 self.assertEqual(type(binop.right), ast.Call)
261 self.assertEqual(binop.lineno, 3)
262 self.assertEqual(binop.left.lineno, 3)
263 self.assertEqual(binop.right.lineno, 3)
264 self.assertEqual(binop.col_offset, 13)
265 self.assertEqual(binop.left.col_offset, 13)
266 self.assertEqual(binop.right.col_offset, 17)
269 self.assertEqual(type(binop), ast.BinOp)
270 self.assertEqual(type(binop.left), ast.Name)
271 self.assertEqual(type(binop.op), ast.Mult)
272 self.assertEqual(type(binop.right), ast.Call)
273 self.assertEqual(binop.lineno, 3)
274 self.assertEqual(binop.left.lineno, 3)
275 self.assertEqual(binop.right.lineno, 3)
276 self.assertEqual(binop.col_offset, 23)
277 self.assertEqual(binop.left.col_offset, 23)
278 self.assertEqual(binop.right.col_offset, 27)
283 self.assertEqual(len(t.body), 1)
284 self.assertEqual(t.body[0].lineno, 1)
286 self.assertEqual(type(t.body[0]), ast.Expr)
287 self.assertEqual(type(t.body[0].value), ast.JoinedStr)
288 self.assertEqual(len(t.body[0].value.values), 3)
290 self.assertEqual(type(t.body[0].value.values[0]), ast.Constant)
291 self.assertEqual(type(t.body[0].value.values[1]), ast.FormattedValue)
292 self.assertEqual(type(t.body[0].value.values[2]), ast.Constant)
297 self.assertEqual(type(name), ast.Name)
298 self.assertEqual(name.lineno, 1)
299 self.assertEqual(name.end_lineno, 1)
300 self.assertEqual(name.col_offset, 22)
301 self.assertEqual(name.end_col_offset, 25)
315 self.assertEqual(type(t), ast.Module)
316 self.assertEqual(len(t.body), 2)
318 self.assertEqual(type(t.body[0]), ast.Assign)
319 self.assertEqual(t.body[0].lineno, 2)
321 self.assertEqual(type(t.body[1]), ast.Expr)
322 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
323 self.assertEqual(len(t.body[1].value.values), 3)
324 self.assertEqual(type(t.body[1].value.values[0]), ast.Constant)
325 self.assertEqual(type(t.body[1].value.values[0].value), str)
326 self.assertEqual(type(t.body[1].value.values[1]), ast.FormattedValue)
327 self.assertEqual(type(t.body[1].value.values[2]), ast.Constant)
328 self.assertEqual(type(t.body[1].value.values[2].value), str)
329 self.assertEqual(t.body[1].lineno, 3)
330 self.assertEqual(t.body[1].value.lineno, 3)
331 self.assertEqual(t.body[1].value.values[0].lineno, 3)
332 self.assertEqual(t.body[1].value.values[1].lineno, 3)
333 self.assertEqual(t.body[1].value.values[2].lineno, 3)
334 self.assertEqual(t.body[1].col_offset, 0)
335 self.assertEqual(t.body[1].value.col_offset, 0)
336 self.assertEqual(t.body[1].value.values[0].col_offset, 0)
337 self.assertEqual(t.body[1].value.values[1].col_offset, 0)
338 self.assertEqual(t.body[1].value.values[2].col_offset, 0)
342 self.assertEqual(type(binop), ast.BinOp)
343 self.assertEqual(type(binop.left), ast.Name)
344 self.assertEqual(type(binop.op), ast.Mult)
345 self.assertEqual(type(binop.right), ast.Call)
346 self.assertEqual(binop.lineno, 4)
347 self.assertEqual(binop.left.lineno, 4)
348 self.assertEqual(binop.right.lineno, 6)
349 self.assertEqual(binop.col_offset, 4)
350 self.assertEqual(binop.left.col_offset, 4)
351 self.assertEqual(binop.right.col_offset, 7)
359 self.assertEqual(type(t), ast.Module)
360 self.assertEqual(len(t.body), 1)
363 self.assertEqual(type(call), ast.Call)
364 self.assertEqual(call.lineno, 3)
365 self.assertEqual(call.end_lineno, 3)
366 self.assertEqual(call.col_offset, 8)
367 self.assertEqual(call.end_col_offset, 15)
379 self.assertEqual(type(t), ast.Module)
380 self.assertEqual(len(t.body), 1)
383 self.assertEqual(type(fstring), ast.JoinedStr)
384 self.assertEqual(len(fstring.values), 3)
387 self.assertEqual(type(wat1), ast.Constant)
388 self.assertEqual(wat1.lineno, 4)
389 self.assertEqual(wat1.end_lineno, 6)
390 self.assertEqual(wat1.col_offset, 12)
391 self.assertEqual(wat1.end_col_offset, 18)
394 self.assertEqual(type(call), ast.Call)
395 self.assertEqual(call.lineno, 5)
396 self.assertEqual(call.end_lineno, 5)
397 self.assertEqual(call.col_offset, 27)
398 self.assertEqual(call.end_col_offset, 31)
400 self.assertEqual(type(wat2), ast.Constant)
401 self.assertEqual(wat2.lineno, 4)
402 self.assertEqual(wat2.end_lineno, 6)
403 self.assertEqual(wat2.col_offset, 12)
404 self.assertEqual(wat2.end_col_offset, 18)
426 self.assertEqual(x[0], 'foo3')
436 self.assertEqual(f'', '')
437 self.assertEqual(f'a', 'a')
438 self.assertEqual(f' ', ' ')
472 self.assertEqual(f'{{', '{')
473 self.assertEqual(f'a{{', 'a{')
474 self.assertEqual(f'{{b', '{b')
475 self.assertEqual(f'a{{b', 'a{b')
476 self.assertEqual(f'}}', '}')
477 self.assertEqual(f'a}}', 'a}')
478 self.assertEqual(f'}}b', '}b')
479 self.assertEqual(f'a}}b', 'a}b')
480 self.assertEqual(f'{{}}', '{}')
481 self.assertEqual(f'a{{}}', 'a{}')
482 self.assertEqual(f'{{b}}', '{b}')
483 self.assertEqual(f'{{}}c', '{}c')
484 self.assertEqual(f'a{{b}}', 'a{b}')
485 self.assertEqual(f'a{{}}c', 'a{}c')
486 self.assertEqual(f'{{b}}c', '{b}c')
487 self.assertEqual(f'a{{b}}c', 'a{b}c')
489 self.assertEqual(f'{{{10}', '{10')
490 self.assertEqual(f'}}{10}', '}10')
491 self.assertEqual(f'}}{{{10}', '}{10')
492 self.assertEqual(f'}}a{{{10}', '}a{10')
494 self.assertEqual(f'{10}{{', '10{')
495 self.assertEqual(f'{10}}}', '10}')
496 self.assertEqual(f'{10}}}{{', '10}{')
497 self.assertEqual(f'{10}}}a{{' '}', '10}a{}')
500 self.assertEqual(f'{"{{}}"}', '{{}}')
508 self.assertEqual('abc' f'## {x}ghi', 'abc## defghi')
509 self.assertEqual('abc' f'{x}' 'ghi', 'abcdefghi')
510 self.assertEqual('abc' f'{x}' 'gh' f'i{x:4}', 'abcdefghidef ')
511 self.assertEqual('{x}' f'{x}', '{x}def')
512 self.assertEqual('{x' f'{x}', '{xdef')
513 self.assertEqual('{x}' f'{x}', '{x}def')
514 self.assertEqual('{{x}}' f'{x}', '{{x}}def')
515 self.assertEqual('{{x' f'{x}', '{{xdef')
516 self.assertEqual('x}}' f'{x}', 'x}}def')
517 self.assertEqual(f'{x}' 'x}}', 'defx}}')
518 self.assertEqual(f'{x}' '', 'def')
519 self.assertEqual('' f'{x}' '', 'def')
520 self.assertEqual('' f'{x}', 'def')
521 self.assertEqual(f'{x}' '2', 'def2')
522 self.assertEqual('1' f'{x}' '2', '1def2')
523 self.assertEqual('1' f'{x}', '1def')
524 self.assertEqual(f'{x}' f'-{x}', 'def-def')
525 self.assertEqual('' f'', '')
526 self.assertEqual('' f'' '', '')
527 self.assertEqual('' f'' '' f'', '')
528 self.assertEqual(f'', '')
529 self.assertEqual(f'' '', '')
530 self.assertEqual(f'' '' f'', '')
531 self.assertEqual(f'' '' f'' '', '')
540 self.assertEqual(f'{"#"}', '#')
541 self.assertEqual(f'{d["#"]}', 'hash')
566 self.assertEqual(eval(build_fstr(i)), (x+' ')*i)
569 self.assertEqual(eval(build_fstr(255)*256), (x+' ')*(255*256))
572 self.assertEqual(eval(s), (x+' ')*254)
576 self.assertEqual(eval(s), '1xy' * 1024)
582 self.assertEqual(f'result: {value:{width}.{precision}}', 'result: 12.35')
583 self.assertEqual(f'result: {value:{width!r}.{precision}}', 'result: 12.35')
584 self.assertEqual(f'result: {value:{width:0}.{precision:1}}', 'result: 12.35')
585 self.assertEqual(f'result: {value:{1}{0:0}.{precision:1}}', 'result: 12.35')
586 self.assertEqual(f'result: {value:{ 1}{ 0:0}.{ precision:1}}', 'result: 12.35')
587 self.assertEqual(f'{10:#{1}0x}', ' 0xa')
588 self.assertEqual(f'{10:{"#"}1{0}{"x"}}', ' 0xa')
589 self.assertEqual(f'{-10:-{"#"}1{0}x}', ' -0xa')
590 self.assertEqual(f'{-10:{"-"}#{1}0{"x"}}', ' -0xa')
591 self.assertEqual(f'{10:#{3 != {4:5} and width}x}', ' 0xa')
624 self.assertEqual(f'{x} {x}', '1 2')
667 self.assertEqual(f'{3,}', '(3,)')
690 self.assertEqual(f'\t', '\t')
691 self.assertEqual(r'\t', '\\t')
692 self.assertEqual(rf'\t', '\\t')
693 self.assertEqual(f'{2}\t', '2\t')
694 self.assertEqual(f'{2}\t{3}', '2\t3')
695 self.assertEqual(f'\t{3}', '\t3')
697 self.assertEqual(f'\u0394', '\u0394')
698 self.assertEqual(r'\u0394', '\\u0394')
699 self.assertEqual(rf'\u0394', '\\u0394')
700 self.assertEqual(f'{2}\u0394', '2\u0394')
701 self.assertEqual(f'{2}\u0394{3}', '2\u03943')
702 self.assertEqual(f'\u0394{3}', '\u03943')
704 self.assertEqual(f'\U00000394', '\u0394')
705 self.assertEqual(r'\U00000394', '\\U00000394')
706 self.assertEqual(rf'\U00000394', '\\U00000394')
707 self.assertEqual(f'{2}\U00000394', '2\u0394')
708 self.assertEqual(f'{2}\U00000394{3}', '2\u03943')
709 self.assertEqual(f'\U00000394{3}', '\u03943')
711 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}', '\u0394')
712 self.assertEqual(f'{2}\N{GREEK CAPITAL LETTER DELTA}', '2\u0394')
713 self.assertEqual(f'{2}\N{GREEK CAPITAL LETTER DELTA}{3}', '2\u03943')
714 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}{3}', '\u03943')
715 self.assertEqual(f'2\N{GREEK CAPITAL LETTER DELTA}', '2\u0394')
716 self.assertEqual(f'2\N{GREEK CAPITAL LETTER DELTA}3', '2\u03943')
717 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}3', '\u03943')
719 self.assertEqual(f'\x20', ' ')
720 self.assertEqual(r'\x20', '\\x20')
721 self.assertEqual(rf'\x20', '\\x20')
722 self.assertEqual(f'{2}\x20', '2 ')
723 self.assertEqual(f'{2}\x20{3}', '2 3')
724 self.assertEqual(f'\x20{3}', ' 3')
726 self.assertEqual(f'2\x20', '2 ')
727 self.assertEqual(f'2\x203', '2 3')
728 self.assertEqual(f'\x203', ' 3')
732 self.assertEqual(value, '\\42')
733 self.assertEqual(f'\\{6*7}', '\\42')
734 self.assertEqual(fr'\{6*7}', '\\42')
739 self.assertEqual(f'\N{AMPERSAND}', '&')
740 self.assertEqual(f'\\N{AMPERSAND}', '\\Nspam')
741 self.assertEqual(fr'\N{AMPERSAND}', '\\Nspam')
742 self.assertEqual(f'\\\N{AMPERSAND}', '\\&')
776 self.assertEqual(f'\x7b1+1}}', '{1+1}')
777 self.assertEqual(f'\x7b1+1', '{1+1')
778 self.assertEqual(f'\u007b1+1', '{1+1')
779 self.assertEqual(f'\N{LEFT CURLY BRACKET}1+1\N{RIGHT CURLY BRACKET}', '{1+1}')
782 self.assertEqual(f'{0}', '0')
783 self.assertEqual(rf'''{3+
788 self.assertEqual(f'{(lambda y:x*y)("8")!r}', "'88888'")
789 self.assertEqual(f'{(lambda y:x*y)("8")!r:10}', "'88888' ")
790 self.assertEqual(f'{(lambda y:x*y)("8"):10}', "88888 ")
806 self.assertEqual(next(g), 8)
807 self.assertEqual(next(g), None)
815 self.assertEqual(the_lambda(4), 40)
816 self.assertEqual(g.send('string'), 'x:string')
819 self.assertEqual(f"{'''x'''}", 'x')
820 self.assertEqual(f"{'''eric's'''}", "eric's")
823 self.assertEqual(f'{"x" """eric"s""" "y"}', 'xeric"sy')
824 self.assertEqual(f'{"x" """eric"s"""}', 'xeric"s')
825 self.assertEqual(f'{"""eric"s""" "y"}', 'eric"sy')
826 self.assertEqual(f'{"""x""" """eric"s""" "y"}', 'xeric"sy')
827 self.assertEqual(f'{"""x""" """eric"s""" """y"""}', 'xeric"sy')
828 self.assertEqual(f'{r"""x""" """eric"s""" """y"""}', 'xeric"sy')
833 self.assertEqual(f'{x}{y}', '98abc')
835 self.assertEqual(f'X{x}{y}', 'X98abc')
836 self.assertEqual(f'{x}X{y}', '98Xabc')
837 self.assertEqual(f'{x}{y}X', '98abcX')
839 self.assertEqual(f'X{x}Y{y}', 'X98Yabc')
840 self.assertEqual(f'X{x}{y}Y', 'X98abcY')
841 self.assertEqual(f'{x}X{y}Y', '98XabcY')
843 self.assertEqual(f'X{x}Y{y}Z', 'X98YabcZ')
851 self.assertEqual(outer('987')(), 'x:987')
852 self.assertEqual(outer(7)(), 'x:7')
859 self.assertEqual(f('foo', 10), 'x=foofoo ')
861 self.assertEqual(f(10, 10), 'x= 20')
865 self.assertEqual(f'v:{value}', 'v:123')
878 self.assertEqual(f'{O():x}', 'x')
879 self.assertEqual(f'{O()}', '*')
880 self.assertEqual(f'{O():}', '*')
882 self.assertEqual(f'{3:}', '3')
883 self.assertEqual(f'{3!s:}', '3')
886 self.assertEqual(f'g:{a_global}', 'g:global variable')
887 self.assertEqual(f'g:{a_global!r}', "g:'global variable'")
890 self.assertEqual(f'g:{a_global} l:{a_local}',
892 self.assertEqual(f'g:{a_global!r}',
894 self.assertEqual(f'g:{a_global} l:{a_local!r}',
901 self.assertEqual(f'g:{a_global}', 'g:really a local')
902 self.assertEqual(f'g:{a_global!r}', "g:'really a local'")
905 self.assertEqual(f'g:{a_global} l:{a_local}',
907 self.assertEqual(f'g:{a_global!r}',
909 self.assertEqual(f'g:{a_global} l:{a_local!r}',
916 self.assertEqual(f'{foo(10)}', 'x=10')
920 self.assertEqual(f'{f"{0}"*3}', '000')
921 self.assertEqual(f'{f"{y}"*3}', '555')
951 self.assertEqual(f'{ 3}', '3')
952 self.assertEqual(f'{ 3}', '3')
953 self.assertEqual(f'{3 }', '3')
954 self.assertEqual(f'{3 }', '3')
956 self.assertEqual(f'expr={ {x: y for x, y in [(1, 2), ]}}',
958 self.assertEqual(f'expr={ {x: y for x, y in [(1, 2), ]} }',
966 self.assertEqual(f'{3!=4}', 'True')
967 self.assertEqual(f'{3!=4:}', 'True')
968 self.assertEqual(f'{3!=4!s}', 'True')
969 self.assertEqual(f'{3!=4!s:.3}', 'Tru')
975 self.assertEqual(f'{0==1}', 'False')
978 self.assertEqual(f'{3.14:10.10}', ' 3.14')
979 self.assertEqual(f'{3.14!s:10.10}', '3.14 ')
980 self.assertEqual(f'{3.14!r:10.10}', '3.14 ')
981 self.assertEqual(f'{3.14!a:10.10}', '3.14 ')
983 self.assertEqual(f'{"a"}', 'a')
984 self.assertEqual(f'{"a"!r}', "'a'")
985 self.assertEqual(f'{"a"!a}', "'a'")
988 self.assertEqual(f'{"a!r"}', "a!r")
991 self.assertEqual(f'{3.14:!<10.10}', '3.14!!!!!!')
1055 self.assertEqual(f'{"{"}', '{')
1056 self.assertEqual(f'{"}"}', '}')
1057 self.assertEqual(f'{3:{"}"}>10}', '}}}}}}}}}3')
1058 self.assertEqual(f'{2:{"{"}>10}', '{{{{{{{{{2')
1071 self.assertEqual(flag, expected)
1079 self.assertEqual(flag, expected)
1087 self.assertEqual(flag, expected)
1100 self.assertEqual(f'{x}', 'test')
1101 self.assertEqual(f'{x:}', 'test')
1102 self.assertEqual(f'{x!s:}', 'test')
1103 self.assertEqual(f'{x!r:}', "'test'")
1110 self.assertEqual(f'{d[0]}', 'integer')
1111 self.assertEqual(f'{d["a"]}', 'string')
1112 self.assertEqual(f'{d[a]}', 'integer')
1113 self.assertEqual('{d[a]}'.format(d=d), 'string')
1114 self.assertEqual('{d[0]}'.format(d=d), 'integer')
1139 self.assertEqual(f'i:{i}', 'i:' + str(i))
1146 self.assertEqual(f'''{d["'"]}''', 'squote')
1147 self.assertEqual(f"""{d['"']}""", 'dquote')
1149 self.assertEqual(f'{d["foo"]}', 'bar')
1150 self.assertEqual(f"{d['foo']}", 'bar')
1155 self.assertEqual(eval('f"\\\n"'), '')
1156 self.assertEqual(eval('f"\\\r"'), '')
1160 self.assertEqual(f'{x=}', 'x=' + repr(x))
1161 self.assertEqual(f'{x =}', 'x =' + repr(x))
1162 self.assertEqual(f'{x=!s}', 'x=' + str(x))
1163 self.assertEqual(f'{x=!r}', 'x=' + repr(x))
1164 self.assertEqual(f'{x=!a}', 'x=' + ascii(x))
1167 self.assertEqual(f'{x=:.2f}', 'x=' + format(x, '.2f'))
1168 self.assertEqual(f'{x=:}', 'x=' + format(x, ''))
1169 self.assertEqual(f'{x=!r:^20}', 'x=' + format(repr(x), '^20'))
1170 self.assertEqual(f'{x=!s:^20}', 'x=' + format(str(x), '^20'))
1171 self.assertEqual(f'{x=!a:^20}', 'x=' + format(ascii(x), '^20'))
1174 self.assertEqual(f'{3*x+15=}', '3*x+15=42')
1179 self.assertEqual(f'{tenπ=:.2f}', 'tenπ=31.40')
1182 self.assertEqual(f'{"Σ"=}', '"Σ"=\'Σ\'')
1185 self.assertEqual(f'{f"{3.1415=:.1f}":*^20}', '*****3.1415=3.1*****')
1190 self.assertEqual(f'alpha α {pi=} ω omega', "alpha α pi='π' ω omega")
1193 self.assertEqual(f'''{
1200 self.assertEqual(f'{0==1}', 'False')
1201 self.assertEqual(f'{0!=1}', 'True')
1202 self.assertEqual(f'{0<=1}', 'True')
1203 self.assertEqual(f'{0>=1}', 'False')
1204 self.assertEqual(f'{(x:="5")}', '5')
1205 self.assertEqual(x, '5')
1206 self.assertEqual(f'{(x:=5)}', '5')
1207 self.assertEqual(x, 5)
1208 self.assertEqual(f'{"="}', '=')
1213 self.assertEqual(f'{x:=10}', ' 20')
1223 self.assertEqual(f'{f(a="3=")}', '0')
1224 self.assertEqual(x, '3=')
1225 self.assertEqual(f'{f(a=4)}', '3=')
1226 self.assertEqual(x, 4)
1235 self.assertEqual(f'{C()=}', 'C()=REPR')
1236 self.assertEqual(f'{C()=!r}', 'C()=REPR')
1237 self.assertEqual(f'{C()=:}', 'C()=FORMAT-')
1238 self.assertEqual(f'{C()=: }', 'C()=FORMAT- ')
1239 self.assertEqual(f'{C()=:x}', 'C()=FORMAT-x')
1240 self.assertEqual(f'{C()=!r:*^20}', 'C()=********REPR********')
1246 self.assertEqual(f'X{x=}Y', 'Xx='+repr(x)+'Y')
1249 self.assertEqual(f'X{x =}Y', 'Xx ='+repr(x)+'Y')
1250 self.assertEqual(f'X{x= }Y', 'Xx= '+repr(x)+'Y')
1251 self.assertEqual(f'X{x = }Y', 'Xx = '+repr(x)+'Y')
1266 self.assertEqual(f'{x:=10}', ' 20')
1269 self.assertEqual(f'{(x:=10)}', '10')
1270 self.assertEqual(x, 10)