• Home
  • Raw
  • Download

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)
225 self.assertEqual(type(t), ast.Module)
226 self.assertEqual(len(t.body), 2)
228 self.assertEqual(type(t.body[0]), ast.Assign)
229 self.assertEqual(t.body[0].lineno, 2)
231 self.assertEqual(type(t.body[1]), ast.Expr)
232 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
233 self.assertEqual(len(t.body[1].value.values), 5)
234 self.assertEqual(type(t.body[1].value.values[0]), ast.FormattedValue)
235 self.assertEqual(type(t.body[1].value.values[1]), ast.Constant)
236 self.assertEqual(type(t.body[1].value.values[1].value), str)
237 self.assertEqual(type(t.body[1].value.values[2]), ast.FormattedValue)
238 self.assertEqual(type(t.body[1].value.values[3]), ast.Constant)
239 self.assertEqual(type(t.body[1].value.values[3].value), str)
240 self.assertEqual(type(t.body[1].value.values[4]), ast.FormattedValue)
241 self.assertEqual(t.body[1].lineno, 3)
242 self.assertEqual(t.body[1].value.lineno, 3)
243 self.assertEqual(t.body[1].value.values[0].lineno, 3)
244 self.assertEqual(t.body[1].value.values[1].lineno, 3)
245 self.assertEqual(t.body[1].value.values[2].lineno, 3)
246 self.assertEqual(t.body[1].value.values[3].lineno, 3)
247 self.assertEqual(t.body[1].value.values[4].lineno, 3)
250 self.assertEqual(type(binop), ast.BinOp)
251 self.assertEqual(type(binop.left), ast.Name)
252 self.assertEqual(type(binop.op), ast.Mult)
253 self.assertEqual(type(binop.right), ast.Call)
254 self.assertEqual(binop.lineno, 3)
255 self.assertEqual(binop.left.lineno, 3)
256 self.assertEqual(binop.right.lineno, 3)
257 self.assertEqual(binop.col_offset, 3)
258 self.assertEqual(binop.left.col_offset, 3)
259 self.assertEqual(binop.right.col_offset, 7)
262 self.assertEqual(type(binop), ast.BinOp)
263 self.assertEqual(type(binop.left), ast.Name)
264 self.assertEqual(type(binop.op), ast.Mult)
265 self.assertEqual(type(binop.right), ast.Call)
266 self.assertEqual(binop.lineno, 3)
267 self.assertEqual(binop.left.lineno, 3)
268 self.assertEqual(binop.right.lineno, 3)
269 self.assertEqual(binop.col_offset, 3) # FIXME: this is wrong
270 self.assertEqual(binop.left.col_offset, 3) # FIXME: this is wrong
271 self.assertEqual(binop.right.col_offset, 7) # FIXME: this is wrong
274 self.assertEqual(type(binop), ast.BinOp)
275 self.assertEqual(type(binop.left), ast.Name)
276 self.assertEqual(type(binop.op), ast.Mult)
277 self.assertEqual(type(binop.right), ast.Call)
278 self.assertEqual(binop.lineno, 3)
279 self.assertEqual(binop.left.lineno, 3)
280 self.assertEqual(binop.right.lineno, 3)
281 self.assertEqual(binop.col_offset, 3) # FIXME: this is wrong
282 self.assertEqual(binop.left.col_offset, 3) # FIXME: this is wrong
283 self.assertEqual(binop.right.col_offset, 7) # FIXME: this is wrong
297 self.assertEqual(type(t), ast.Module)
298 self.assertEqual(len(t.body), 2)
300 self.assertEqual(type(t.body[0]), ast.Assign)
301 self.assertEqual(t.body[0].lineno, 2)
303 self.assertEqual(type(t.body[1]), ast.Expr)
304 self.assertEqual(type(t.body[1].value), ast.JoinedStr)
305 self.assertEqual(len(t.body[1].value.values), 3)
306 self.assertEqual(type(t.body[1].value.values[0]), ast.Constant)
307 self.assertEqual(type(t.body[1].value.values[0].value), str)
308 self.assertEqual(type(t.body[1].value.values[1]), ast.FormattedValue)
309 self.assertEqual(type(t.body[1].value.values[2]), ast.Constant)
310 self.assertEqual(type(t.body[1].value.values[2].value), str)
311 self.assertEqual(t.body[1].lineno, 3)
312 self.assertEqual(t.body[1].value.lineno, 3)
313 self.assertEqual(t.body[1].value.values[0].lineno, 3)
314 self.assertEqual(t.body[1].value.values[1].lineno, 3)
315 self.assertEqual(t.body[1].value.values[2].lineno, 3)
316 self.assertEqual(t.body[1].col_offset, 0)
317 self.assertEqual(t.body[1].value.col_offset, 0)
318 self.assertEqual(t.body[1].value.values[0].col_offset, 0)
319 self.assertEqual(t.body[1].value.values[1].col_offset, 0)
320 self.assertEqual(t.body[1].value.values[2].col_offset, 0)
324 self.assertEqual(type(binop), ast.BinOp)
325 self.assertEqual(type(binop.left), ast.Name)
326 self.assertEqual(type(binop.op), ast.Mult)
327 self.assertEqual(type(binop.right), ast.Call)
328 self.assertEqual(binop.lineno, 4)
329 self.assertEqual(binop.left.lineno, 4)
330 self.assertEqual(binop.right.lineno, 6)
331 self.assertEqual(binop.col_offset, 4)
332 self.assertEqual(binop.left.col_offset, 4)
333 self.assertEqual(binop.right.col_offset, 7)
355 self.assertEqual(x[0], 'foo3')
365 self.assertEqual(f'', '')
366 self.assertEqual(f'a', 'a')
367 self.assertEqual(f' ', ' ')
401 self.assertEqual(f'{{', '{')
402 self.assertEqual(f'a{{', 'a{')
403 self.assertEqual(f'{{b', '{b')
404 self.assertEqual(f'a{{b', 'a{b')
405 self.assertEqual(f'}}', '}')
406 self.assertEqual(f'a}}', 'a}')
407 self.assertEqual(f'}}b', '}b')
408 self.assertEqual(f'a}}b', 'a}b')
409 self.assertEqual(f'{{}}', '{}')
410 self.assertEqual(f'a{{}}', 'a{}')
411 self.assertEqual(f'{{b}}', '{b}')
412 self.assertEqual(f'{{}}c', '{}c')
413 self.assertEqual(f'a{{b}}', 'a{b}')
414 self.assertEqual(f'a{{}}c', 'a{}c')
415 self.assertEqual(f'{{b}}c', '{b}c')
416 self.assertEqual(f'a{{b}}c', 'a{b}c')
418 self.assertEqual(f'{{{10}', '{10')
419 self.assertEqual(f'}}{10}', '}10')
420 self.assertEqual(f'}}{{{10}', '}{10')
421 self.assertEqual(f'}}a{{{10}', '}a{10')
423 self.assertEqual(f'{10}{{', '10{')
424 self.assertEqual(f'{10}}}', '10}')
425 self.assertEqual(f'{10}}}{{', '10}{')
426 self.assertEqual(f'{10}}}a{{' '}', '10}a{}')
429 self.assertEqual(f'{"{{}}"}', '{{}}')
437 self.assertEqual('abc' f'## {x}ghi', 'abc## defghi')
438 self.assertEqual('abc' f'{x}' 'ghi', 'abcdefghi')
439 self.assertEqual('abc' f'{x}' 'gh' f'i{x:4}', 'abcdefghidef ')
440 self.assertEqual('{x}' f'{x}', '{x}def')
441 self.assertEqual('{x' f'{x}', '{xdef')
442 self.assertEqual('{x}' f'{x}', '{x}def')
443 self.assertEqual('{{x}}' f'{x}', '{{x}}def')
444 self.assertEqual('{{x' f'{x}', '{{xdef')
445 self.assertEqual('x}}' f'{x}', 'x}}def')
446 self.assertEqual(f'{x}' 'x}}', 'defx}}')
447 self.assertEqual(f'{x}' '', 'def')
448 self.assertEqual('' f'{x}' '', 'def')
449 self.assertEqual('' f'{x}', 'def')
450 self.assertEqual(f'{x}' '2', 'def2')
451 self.assertEqual('1' f'{x}' '2', '1def2')
452 self.assertEqual('1' f'{x}', '1def')
453 self.assertEqual(f'{x}' f'-{x}', 'def-def')
454 self.assertEqual('' f'', '')
455 self.assertEqual('' f'' '', '')
456 self.assertEqual('' f'' '' f'', '')
457 self.assertEqual(f'', '')
458 self.assertEqual(f'' '', '')
459 self.assertEqual(f'' '' f'', '')
460 self.assertEqual(f'' '' f'' '', '')
469 self.assertEqual(f'{"#"}', '#')
470 self.assertEqual(f'{d["#"]}', 'hash')
495 self.assertEqual(eval(build_fstr(i)), (x+' ')*i)
498 self.assertEqual(eval(build_fstr(255)*256), (x+' ')*(255*256))
501 self.assertEqual(eval(s), (x+' ')*254)
505 self.assertEqual(eval(s), '1xy' * 1024)
511 self.assertEqual(f'result: {value:{width}.{precision}}', 'result: 12.35')
512 self.assertEqual(f'result: {value:{width!r}.{precision}}', 'result: 12.35')
513 self.assertEqual(f'result: {value:{width:0}.{precision:1}}', 'result: 12.35')
514 self.assertEqual(f'result: {value:{1}{0:0}.{precision:1}}', 'result: 12.35')
515 self.assertEqual(f'result: {value:{ 1}{ 0:0}.{ precision:1}}', 'result: 12.35')
516 self.assertEqual(f'{10:#{1}0x}', ' 0xa')
517 self.assertEqual(f'{10:{"#"}1{0}{"x"}}', ' 0xa')
518 self.assertEqual(f'{-10:-{"#"}1{0}x}', ' -0xa')
519 self.assertEqual(f'{-10:{"-"}#{1}0{"x"}}', ' -0xa')
520 self.assertEqual(f'{10:#{3 != {4:5} and width}x}', ' 0xa')
554 self.assertEqual(f'{x} {x}', '1 2')
597 self.assertEqual(f'{3,}', '(3,)')
618 self.assertEqual(f'\t', '\t')
619 self.assertEqual(r'\t', '\\t')
620 self.assertEqual(rf'\t', '\\t')
621 self.assertEqual(f'{2}\t', '2\t')
622 self.assertEqual(f'{2}\t{3}', '2\t3')
623 self.assertEqual(f'\t{3}', '\t3')
625 self.assertEqual(f'\u0394', '\u0394')
626 self.assertEqual(r'\u0394', '\\u0394')
627 self.assertEqual(rf'\u0394', '\\u0394')
628 self.assertEqual(f'{2}\u0394', '2\u0394')
629 self.assertEqual(f'{2}\u0394{3}', '2\u03943')
630 self.assertEqual(f'\u0394{3}', '\u03943')
632 self.assertEqual(f'\U00000394', '\u0394')
633 self.assertEqual(r'\U00000394', '\\U00000394')
634 self.assertEqual(rf'\U00000394', '\\U00000394')
635 self.assertEqual(f'{2}\U00000394', '2\u0394')
636 self.assertEqual(f'{2}\U00000394{3}', '2\u03943')
637 self.assertEqual(f'\U00000394{3}', '\u03943')
639 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}', '\u0394')
640 self.assertEqual(f'{2}\N{GREEK CAPITAL LETTER DELTA}', '2\u0394')
641 self.assertEqual(f'{2}\N{GREEK CAPITAL LETTER DELTA}{3}', '2\u03943')
642 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}{3}', '\u03943')
643 self.assertEqual(f'2\N{GREEK CAPITAL LETTER DELTA}', '2\u0394')
644 self.assertEqual(f'2\N{GREEK CAPITAL LETTER DELTA}3', '2\u03943')
645 self.assertEqual(f'\N{GREEK CAPITAL LETTER DELTA}3', '\u03943')
647 self.assertEqual(f'\x20', ' ')
648 self.assertEqual(r'\x20', '\\x20')
649 self.assertEqual(rf'\x20', '\\x20')
650 self.assertEqual(f'{2}\x20', '2 ')
651 self.assertEqual(f'{2}\x20{3}', '2 3')
652 self.assertEqual(f'\x20{3}', ' 3')
654 self.assertEqual(f'2\x20', '2 ')
655 self.assertEqual(f'2\x203', '2 3')
656 self.assertEqual(f'\x203', ' 3')
660 self.assertEqual(value, '\\42')
661 self.assertEqual(f'\\{6*7}', '\\42')
662 self.assertEqual(fr'\{6*7}', '\\42')
667 self.assertEqual(f'\N{AMPERSAND}', '&')
668 self.assertEqual(f'\\N{AMPERSAND}', '\\Nspam')
669 self.assertEqual(fr'\N{AMPERSAND}', '\\Nspam')
670 self.assertEqual(f'\\\N{AMPERSAND}', '\\&')
704 self.assertEqual(f'\x7b1+1}}', '{1+1}')
705 self.assertEqual(f'\x7b1+1', '{1+1')
706 self.assertEqual(f'\u007b1+1', '{1+1')
707 self.assertEqual(f'\N{LEFT CURLY BRACKET}1+1\N{RIGHT CURLY BRACKET}', '{1+1}')
710 self.assertEqual(f'{0}', '0')
711 self.assertEqual(rf'''{3+
716 self.assertEqual(f'{(lambda y:x*y)("8")!r}', "'88888'")
717 self.assertEqual(f'{(lambda y:x*y)("8")!r:10}', "'88888' ")
718 self.assertEqual(f'{(lambda y:x*y)("8"):10}', "88888 ")
735 self.assertEqual(next(g), 8)
736 self.assertEqual(next(g), None)
744 self.assertEqual(the_lambda(4), 40)
745 self.assertEqual(g.send('string'), 'x:string')
748 self.assertEqual(f"{'''x'''}", 'x')
749 self.assertEqual(f"{'''eric's'''}", "eric's")
752 self.assertEqual(f'{"x" """eric"s""" "y"}', 'xeric"sy')
753 self.assertEqual(f'{"x" """eric"s"""}', 'xeric"s')
754 self.assertEqual(f'{"""eric"s""" "y"}', 'eric"sy')
755 self.assertEqual(f'{"""x""" """eric"s""" "y"}', 'xeric"sy')
756 self.assertEqual(f'{"""x""" """eric"s""" """y"""}', 'xeric"sy')
757 self.assertEqual(f'{r"""x""" """eric"s""" """y"""}', 'xeric"sy')
762 self.assertEqual(f'{x}{y}', '98abc')
764 self.assertEqual(f'X{x}{y}', 'X98abc')
765 self.assertEqual(f'{x}X{y}', '98Xabc')
766 self.assertEqual(f'{x}{y}X', '98abcX')
768 self.assertEqual(f'X{x}Y{y}', 'X98Yabc')
769 self.assertEqual(f'X{x}{y}Y', 'X98abcY')
770 self.assertEqual(f'{x}X{y}Y', '98XabcY')
772 self.assertEqual(f'X{x}Y{y}Z', 'X98YabcZ')
780 self.assertEqual(outer('987')(), 'x:987')
781 self.assertEqual(outer(7)(), 'x:7')
788 self.assertEqual(f('foo', 10), 'x=foofoo ')
790 self.assertEqual(f(10, 10), 'x= 20')
794 self.assertEqual(f'v:{value}', 'v:123')
807 self.assertEqual(f'{O():x}', 'x')
808 self.assertEqual(f'{O()}', '*')
809 self.assertEqual(f'{O():}', '*')
811 self.assertEqual(f'{3:}', '3')
812 self.assertEqual(f'{3!s:}', '3')
815 self.assertEqual(f'g:{a_global}', 'g:global variable')
816 self.assertEqual(f'g:{a_global!r}', "g:'global variable'")
819 self.assertEqual(f'g:{a_global} l:{a_local}',
821 self.assertEqual(f'g:{a_global!r}',
823 self.assertEqual(f'g:{a_global} l:{a_local!r}',
830 self.assertEqual(f'g:{a_global}', 'g:really a local')
831 self.assertEqual(f'g:{a_global!r}', "g:'really a local'")
834 self.assertEqual(f'g:{a_global} l:{a_local}',
836 self.assertEqual(f'g:{a_global!r}',
838 self.assertEqual(f'g:{a_global} l:{a_local!r}',
845 self.assertEqual(f'{foo(10)}', 'x=10')
849 self.assertEqual(f'{f"{0}"*3}', '000')
850 self.assertEqual(f'{f"{y}"*3}', '555')
885 self.assertEqual(f'{ 3}', '3')
886 self.assertEqual(f'{ 3}', '3')
887 self.assertEqual(f'{3 }', '3')
888 self.assertEqual(f'{3 }', '3')
890 self.assertEqual(f'expr={ {x: y for x, y in [(1, 2), ]}}',
892 self.assertEqual(f'expr={ {x: y for x, y in [(1, 2), ]} }',
900 self.assertEqual(f'{3!=4}', 'True')
901 self.assertEqual(f'{3!=4:}', 'True')
902 self.assertEqual(f'{3!=4!s}', 'True')
903 self.assertEqual(f'{3!=4!s:.3}', 'Tru')
909 self.assertEqual(f'{0==1}', 'False')
912 self.assertEqual(f'{3.14:10.10}', ' 3.14')
913 self.assertEqual(f'{3.14!s:10.10}', '3.14 ')
914 self.assertEqual(f'{3.14!r:10.10}', '3.14 ')
915 self.assertEqual(f'{3.14!a:10.10}', '3.14 ')
917 self.assertEqual(f'{"a"}', 'a')
918 self.assertEqual(f'{"a"!r}', "'a'")
919 self.assertEqual(f'{"a"!a}', "'a'")
922 self.assertEqual(f'{"a!r"}', "a!r")
925 self.assertEqual(f'{3.14:!<10.10}', '3.14!!!!!!')
989 self.assertEqual(f'{"{"}', '{')
990 self.assertEqual(f'{"}"}', '}')
991 self.assertEqual(f'{3:{"}"}>10}', '}}}}}}}}}3')
992 self.assertEqual(f'{2:{"{"}>10}', '{{{{{{{{{2')
1005 self.assertEqual(flag, expected)
1013 self.assertEqual(flag, expected)
1021 self.assertEqual(flag, expected)
1034 self.assertEqual(f'{x}', 'test')
1035 self.assertEqual(f'{x:}', 'test')
1036 self.assertEqual(f'{x!s:}', 'test')
1037 self.assertEqual(f'{x!r:}', "'test'")
1044 self.assertEqual(f'{d[0]}', 'integer')
1045 self.assertEqual(f'{d["a"]}', 'string')
1046 self.assertEqual(f'{d[a]}', 'integer')
1047 self.assertEqual('{d[a]}'.format(d=d), 'string')
1048 self.assertEqual('{d[0]}'.format(d=d), 'integer')
1074 self.assertEqual(f'i:{i}', 'i:' + str(i))
1081 self.assertEqual(f'''{d["'"]}''', 'squote')
1082 self.assertEqual(f"""{d['"']}""", 'dquote')
1084 self.assertEqual(f'{d["foo"]}', 'bar')
1085 self.assertEqual(f"{d['foo']}", 'bar')
1090 self.assertEqual(eval('f"\\\n"'), '')
1091 self.assertEqual(eval('f"\\\r"'), '')
1095 self.assertEqual(f'{x=}', 'x=' + repr(x))
1096 self.assertEqual(f'{x =}', 'x =' + repr(x))
1097 self.assertEqual(f'{x=!s}', 'x=' + str(x))
1098 self.assertEqual(f'{x=!r}', 'x=' + repr(x))
1099 self.assertEqual(f'{x=!a}', 'x=' + ascii(x))
1102 self.assertEqual(f'{x=:.2f}', 'x=' + format(x, '.2f'))
1103 self.assertEqual(f'{x=:}', 'x=' + format(x, ''))
1104 self.assertEqual(f'{x=!r:^20}', 'x=' + format(repr(x), '^20'))
1105 self.assertEqual(f'{x=!s:^20}', 'x=' + format(str(x), '^20'))
1106 self.assertEqual(f'{x=!a:^20}', 'x=' + format(ascii(x), '^20'))
1109 self.assertEqual(f'{3*x+15=}', '3*x+15=42')
1114 self.assertEqual(f'{tenπ=:.2f}', 'tenπ=31.40')
1117 self.assertEqual(f'{"Σ"=}', '"Σ"=\'Σ\'')
1120 self.assertEqual(f'{f"{3.1415=:.1f}":*^20}', '*****3.1415=3.1*****')
1125 self.assertEqual(f'alpha α {pi=} ω omega', "alpha α pi='π' ω omega")
1128 self.assertEqual(f'''{
1135 self.assertEqual(f'{0==1}', 'False')
1136 self.assertEqual(f'{0!=1}', 'True')
1137 self.assertEqual(f'{0<=1}', 'True')
1138 self.assertEqual(f'{0>=1}', 'False')
1139 self.assertEqual(f'{(x:="5")}', '5')
1140 self.assertEqual(x, '5')
1141 self.assertEqual(f'{(x:=5)}', '5')
1142 self.assertEqual(x, 5)
1143 self.assertEqual(f'{"="}', '=')
1148 self.assertEqual(f'{x:=10}', ' 20')
1158 self.assertEqual(f'{f(a="3=")}', '0')
1159 self.assertEqual(x, '3=')
1160 self.assertEqual(f'{f(a=4)}', '3=')
1161 self.assertEqual(x, 4)
1170 self.assertEqual(f'{C()=}', 'C()=REPR')
1171 self.assertEqual(f'{C()=!r}', 'C()=REPR')
1172 self.assertEqual(f'{C()=:}', 'C()=FORMAT-')
1173 self.assertEqual(f'{C()=: }', 'C()=FORMAT- ')
1174 self.assertEqual(f'{C()=:x}', 'C()=FORMAT-x')
1175 self.assertEqual(f'{C()=!r:*^20}', 'C()=********REPR********')
1181 self.assertEqual(f'X{x=}Y', 'Xx='+repr(x)+'Y')
1184 self.assertEqual(f'X{x =}Y', 'Xx ='+repr(x)+'Y')
1185 self.assertEqual(f'X{x= }Y', 'Xx= '+repr(x)+'Y')
1186 self.assertEqual(f'X{x = }Y', 'Xx = '+repr(x)+'Y')
1201 self.assertEqual(f'{x:=10}', ' 20')
1204 self.assertEqual(f'{(x:=10)}', '10')
1205 self.assertEqual(x, 10)