mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
PY-31442 Add a test on parsing of empty f-strings
This commit is contained in:
5
python/testData/psi/EmptyFStrings.py
Normal file
5
python/testData/psi/EmptyFStrings.py
Normal file
@@ -0,0 +1,5 @@
|
||||
s = (f'',
|
||||
F"",
|
||||
rf"""""",
|
||||
FR'''''',
|
||||
)
|
||||
35
python/testData/psi/EmptyFStrings.txt
Normal file
35
python/testData/psi/EmptyFStrings.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
PyFile:EmptyFStrings.py
|
||||
PyAssignmentStatement
|
||||
PyTargetExpression: s
|
||||
PsiElement(Py:IDENTIFIER)('s')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PyParenthesizedExpression
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PyTupleExpression
|
||||
PyStringLiteralExpression:
|
||||
PyFormattedStringNode
|
||||
PsiElement(Py:FSTRING_START)('f'')
|
||||
PsiElement(Py:FSTRING_END)(''')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStringLiteralExpression:
|
||||
PyFormattedStringNode
|
||||
PsiElement(Py:FSTRING_START)('F"')
|
||||
PsiElement(Py:FSTRING_END)('"')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStringLiteralExpression:
|
||||
PyFormattedStringNode
|
||||
PsiElement(Py:FSTRING_START)('rf"""')
|
||||
PsiElement(Py:FSTRING_END)('"""')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStringLiteralExpression:
|
||||
PyFormattedStringNode
|
||||
PsiElement(Py:FSTRING_START)('FR'''')
|
||||
PsiElement(Py:FSTRING_END)(''''')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
@@ -508,6 +508,10 @@ public class PythonParsingTest extends ParsingTestCase {
|
||||
doTest(LanguageLevel.PYTHON36);
|
||||
}
|
||||
|
||||
public void testEmptyFStrings() {
|
||||
doTest(LanguageLevel.PYTHON36);
|
||||
}
|
||||
|
||||
// PY-31442
|
||||
public void testFStringWithSimpleFragment() {
|
||||
doTest(LanguageLevel.PYTHON36);
|
||||
|
||||
Reference in New Issue
Block a user