aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_fstring.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 31d91215889..1d96b7a2c24 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -1649,6 +1649,14 @@ x = (
#self.assertEqual(f'X{x =}Y', 'Xx\t='+repr(x)+'Y')
#self.assertEqual(f'X{x = }Y', 'Xx\t=\t'+repr(x)+'Y')
+ def test_debug_expressions_are_raw_strings(self):
+
+ self.assertEqual(f'{b"\N{OX}"=}', 'b"\\N{OX}"=b\'\\\\N{OX}\'')
+ self.assertEqual(f'{r"\xff"=}', 'r"\\xff"=\'\\\\xff\'')
+ self.assertEqual(f'{r"\n"=}', 'r"\\n"=\'\\\\n\'')
+ self.assertEqual(f"{'\''=}", "'\\''=\"'\"")
+ self.assertEqual(f'{'\xc5'=}', r"'\xc5'='Å'")
+
def test_walrus(self):
x = 20
# This isn't an assignment expression, it's 'x', with a format