mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 17:20:54 +07:00
25 lines
1.1 KiB
Java
25 lines
1.1 KiB
Java
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
|
package com.intellij.codeInsight.folding.impl;
|
|
|
|
import com.intellij.psi.PsiElement;
|
|
import com.intellij.psi.javadoc.PsiDocComment;
|
|
import com.intellij.psi.util.PsiTreeUtil;
|
|
|
|
public class JavaFoldingPolicyTest extends AbstractFoldingPolicyTest {
|
|
public void testAdditionalChildDocComments() {
|
|
myFixture.configureByText("Test.java",
|
|
"""
|
|
/** outer **/
|
|
class Test {
|
|
/** <caret>inner **/
|
|
}""");
|
|
PsiElement element = PsiTreeUtil.getParentOfType(myFixture.getFile().findElementAt(myFixture.getCaretOffset()),
|
|
PsiDocComment.class, false);
|
|
assertNotNull(element);
|
|
String signature = FoldingPolicy.getSignature(element);
|
|
if (signature != null) {
|
|
assertEquals(element, FoldingPolicy.restoreBySignature(element.getContainingFile(), signature));
|
|
}
|
|
}
|
|
}
|