summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_fstring.py')
-rw-r--r--Lib/test/test_fstring.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index b398704..3d762b5 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -780,5 +780,11 @@ f'{a * x()}'"""
self.assertEqual(f'{d["foo"]}', 'bar')
self.assertEqual(f"{d['foo']}", 'bar')
+ def test_backslash_char(self):
+ # Check eval of a backslash followed by a control char.
+ # See bpo-30682: this used to raise an assert in pydebug mode.
+ self.assertEqual(eval('f"\\\n"'), '')
+ self.assertEqual(eval('f"\\\r"'), '')
+
if __name__ == '__main__':
unittest.main()