a test for smart completion in try-with-resources

This commit is contained in:
peter
2011-12-23 18:48:11 +01:00
parent c579d1f9fc
commit 4a5a55c409
3 changed files with 19 additions and 1 deletions
@@ -0,0 +1,8 @@
class MyClass {
static class MyResource implements AutoCloseable { }
void f(MyResource resource) {
try (final MyResource c = resource<caret>) {
}
}
}
@@ -0,0 +1,8 @@
class MyClass {
static class MyResource implements AutoCloseable { }
void f(MyResource resource) {
try (final MyResource c = r<caret>) {
}
}
}
@@ -49,6 +49,8 @@ public class SmartType17CompletionTest extends LightFixtureCompletionTestCase {
doTest();
}
public void testTryWithResourcesNoSemicolon() { doTest(); }
public void testDiamondPresentation() {
configureByFile("/" + getTestName(false) + ".java");
LookupElementPresentation presentation = new LookupElementPresentation();
@@ -57,7 +59,7 @@ public class SmartType17CompletionTest extends LightFixtureCompletionTestCase {
}
private void doTest() throws Exception {
private void doTest() {
configureByFile("/" + getTestName(false) + ".java");
if (myItems != null && myItems.length == 1) {
final Lookup lookup = getLookup();