summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy')
-rw-r--r--java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy26
1 files changed, 26 insertions, 0 deletions
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
index 3acb9845df66..d866ddd783cf 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
@@ -797,4 +797,30 @@ class Foo {
}
"""
}
+
+ public void "test two static imports"() {
+ myFixture.configureByText "a.java", """
+
+class Foo {
+ {
+ <caret>
+ }
+}
+"""
+ final TemplateManager manager = TemplateManager.getInstance(getProject());
+ final Template template = manager.createTemplate("xxx", "user", 'java.lang.Math.abs(java.lang.Math.PI);');
+ template.setValue(USE_STATIC_IMPORT_IF_POSSIBLE, true);
+
+ startTemplate(template);
+ myFixture.checkResult """\
+import static java.lang.Math.PI;
+import static java.lang.Math.abs;
+
+class Foo {
+ {
+ abs(PI);<caret>
+ }
+}
+"""
+ }
}