summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strlit.py
diff options
context:
space:
mode:
authorChristian Heimes <c.heimes@cheimes.de>2012-06-20 09:17:58 (GMT)
committerChristian Heimes <c.heimes@cheimes.de>2012-06-20 09:17:58 (GMT)
commit0b3847de6dbe451d38d8de940717a5a1f186c2e9 (patch)
tree62f54dd84693e7b25deae94699b8c240d824b806 /Lib/test/test_strlit.py
parent10c8791978203be95af2c4c1d7ce33496fac880c (diff)
downloadcpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.zip
cpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.tar.gz
cpython-0b3847de6dbe451d38d8de940717a5a1f186c2e9.tar.bz2
Issue #15096: Drop support for the ur string prefix
Diffstat (limited to 'Lib/test/test_strlit.py')
-rw-r--r--Lib/test/test_strlit.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_strlit.py b/Lib/test/test_strlit.py
index 1f041c8..07bc488 100644
--- a/Lib/test/test_strlit.py
+++ b/Lib/test/test_strlit.py
@@ -123,6 +123,15 @@ class TestLiterals(unittest.TestCase):
self.assertRaises(SyntaxError, eval, """ rrb'' """)
self.assertRaises(SyntaxError, eval, """ rbb'' """)
+ def test_eval_str_u(self):
+ self.assertEqual(eval(""" u'x' """), 'x')
+ self.assertEqual(eval(""" U'\u00e4' """), 'ä')
+ self.assertEqual(eval(""" u'\N{LATIN SMALL LETTER A WITH DIAERESIS}' """), 'ä')
+ self.assertRaises(SyntaxError, eval, """ ur'' """)
+ self.assertRaises(SyntaxError, eval, """ ru'' """)
+ self.assertRaises(SyntaxError, eval, """ bu'' """)
+ self.assertRaises(SyntaxError, eval, """ ub'' """)
+
def check_encoding(self, encoding, extra=""):
modname = "xx_" + encoding.replace("-", "_")
fn = os.path.join(self.tmpdir, modname + ".py")