mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fixed issue #25034: Fix string.Formatter problem with auto-numbering
and nested format_specs. Patch by Anthon van der Neut.
This commit is contained in:
parent
b8b951f6ee
commit
85976b14dd
4 changed files with 12 additions and 5 deletions
|
@ -54,6 +54,8 @@ class ModuleTest(unittest.TestCase):
|
|||
'foo{1}{num}{1}'.format(None, 'bar', num=6))
|
||||
self.assertEqual(fmt.format('{:^{}}', 'bar', 6),
|
||||
'{:^{}}'.format('bar', 6))
|
||||
self.assertEqual(fmt.format('{:^{}} {}', 'bar', 6, 'X'),
|
||||
'{:^{}} {}'.format('bar', 6, 'X'))
|
||||
self.assertEqual(fmt.format('{:^{pad}}{}', 'foo', 'bar', pad=6),
|
||||
'{:^{pad}}{}'.format('foo', 'bar', pad=6))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue