mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added test for flattening union types
This commit is contained in:
@@ -263,6 +263,14 @@ public class PyTypingTest extends PyTestCase {
|
||||
" pass\n");
|
||||
}
|
||||
|
||||
public void testFlattenUnions() {
|
||||
doTest("Union[int, str, list]",
|
||||
"from typing import Union\n" +
|
||||
"\n" +
|
||||
"def foo(expr: Union[int, Union[str, list]]):\n" +
|
||||
" pass\n");
|
||||
}
|
||||
|
||||
private void doTest(@NotNull String expectedType, @NotNull String text) {
|
||||
myFixture.copyDirectoryToProject("typing", "");
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
|
||||
Reference in New Issue
Block a user