closes bpo-34515: Support non-ASCII identifiers in lib2to3. (GH-8950)

This commit is contained in:
Monson Shao 2018-09-16 01:32:29 +08:00 committed by Benjamin Peterson
parent d2067318c7
commit 10a428b64b
3 changed files with 16 additions and 6 deletions

View file

@ -529,6 +529,16 @@ class TestSetLiteral(GrammarTest):
self.validate("""x = {2, 3, 4,}""")
# Adapted from Python 3's Lib/test/test_unicode_identifiers.py and
# Lib/test/test_tokenize.py:TokenizeTest.test_non_ascii_identifiers
class TestIdentfier(GrammarTest):
def test_non_ascii_identifiers(self):
self.validate("Örter = 'places'\ngrün = 'green'")
self.validate("蟒 = a蟒 = 锦蛇 = 1")
self.validate("µ = aµ = µµ = 1")
self.validate("𝔘𝔫𝔦𝔠𝔬𝔡𝔢 = a_𝔘𝔫𝔦𝔠𝔬𝔡𝔢 = 1")
class TestNumericLiterals(GrammarTest):
def test_new_octal_notation(self):
self.validate("""0o7777777777777""")