summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@unpythonic.net>2025-11-30 16:24:01 -0600
committerDamien George <damien@micropython.org>2025-12-17 00:14:59 +1100
commitef567dc9281e6ffff991bf4cd18df48c9043b207 (patch)
tree01f99aa70c53c77c73be468fc3520050a9be4feb
parentb78fac161e34eb953c499eb17630e67355a9508a (diff)
tests/basics/string_fstring.py: Test fstring nested replacement fields.
This does not actually cover any additional lines, but it does cover new functionality not previously covered. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
-rw-r--r--tests/basics/string_fstring.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/string_fstring.py b/tests/basics/string_fstring.py
index d94cc0cd3..200065e9d 100644
--- a/tests/basics/string_fstring.py
+++ b/tests/basics/string_fstring.py
@@ -79,3 +79,14 @@ print(
# Raw f-strings.
print(rf"\r\a\w {'f'} \s\t\r\i\n\g")
print(fr"\r{x}")
+
+# Format specifiers with nested replacement fields
+space = 5
+prec = 2
+print(f"{3.14:{space}.{prec}}")
+
+space_prec = "5.2"
+print(f"{3.14:{space_prec}}")
+
+radix = "x"
+print(f"{314:{radix}}")