mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-79967 Add a couple of tests for t-strings type
GitOrigin-RevId: 3899f67f814b7a0d197db662d3f64693ef61208a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5e12117835
commit
56ba10d20f
@@ -3667,6 +3667,34 @@ public class Py3TypeTest extends PyTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
// PY-79967
|
||||
public void testTypeOfTemplateStringInferredAsTemplateForPython314() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON314, () -> {
|
||||
doTest("Template", """
|
||||
expr = t"template string"
|
||||
""");
|
||||
});
|
||||
}
|
||||
|
||||
// PY-79967
|
||||
public void testTypeOfTemplateStringInferredAsStrForPython314() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON313, () -> {
|
||||
doTest("str", """
|
||||
expr = t"template string"
|
||||
""");
|
||||
});
|
||||
}
|
||||
|
||||
// PY-79967
|
||||
public void testInterpolationExpressionTypeFromTemplateString() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON314, () -> {
|
||||
doTest("str", """
|
||||
name = "John"
|
||||
expr = t"Hello, {name}!".interpolations[0].expression
|
||||
""");
|
||||
});
|
||||
}
|
||||
|
||||
private void doTest(final String expectedType, final String text) {
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
final PyExpression expr = myFixture.findElementByText("expr", PyExpression.class);
|
||||
|
||||
Reference in New Issue
Block a user