summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tokenize.py
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2023-06-15 16:21:24 (GMT)
committerGitHub <noreply@github.com>2023-06-15 16:21:24 (GMT)
commitd382ad49157b3802fc5619f68d96810def517869 (patch)
treea17121aac146c3797007502c55b6c105d298c7f2 /Lib/test/test_tokenize.py
parent8f10140e74d141a0a894702044e213e6f0690d9c (diff)
downloadcpython-d382ad49157b3802fc5619f68d96810def517869.zip
cpython-d382ad49157b3802fc5619f68d96810def517869.tar.gz
cpython-d382ad49157b3802fc5619f68d96810def517869.tar.bz2
gh-105820: Fix tok_mode expression buffer in file & readline tokenizer (#105828)
Diffstat (limited to 'Lib/test/test_tokenize.py')
-rw-r--r--Lib/test/test_tokenize.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index 15f5363..5ad2784 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -559,6 +559,19 @@ def"', """\
FSTRING_MIDDLE ' final words' (1, 40) (1, 52)
FSTRING_END "'" (1, 52) (1, 53)
""")
+ self.check_tokenize("""\
+f'''{
+3
+=}'''""", """\
+ FSTRING_START "f'''" (1, 0) (1, 4)
+ OP '{' (1, 4) (1, 5)
+ NL '\\n' (1, 5) (1, 6)
+ NUMBER '3' (2, 0) (2, 1)
+ NL '\\n' (2, 1) (2, 2)
+ OP '=' (3, 0) (3, 1)
+ OP '}' (3, 1) (3, 2)
+ FSTRING_END "'''" (3, 2) (3, 5)
+ """)
def test_function(self):
self.check_tokenize("def d22(a, b, c=2, d=2, *k): pass", """\