Make JetTestUtils.getLastCommentInFile() to allow trailing newline

Many editors add a trailing newline when saving. Allow them in
getLastCommentInFile.
This commit is contained in:
Tuomas Tynkkynen
2014-02-07 15:08:57 -08:00
committed by Nikolay Krasko
parent 420a08167b
commit 7429cc8819
@@ -531,6 +531,9 @@ public class JetTestUtils {
public static String getLastCommentInFile(JetFile file) {
PsiElement lastChild = file.getLastChild();
if (lastChild != null && lastChild.getNode().getElementType().equals(JetTokens.WHITE_SPACE)) {
lastChild = lastChild.getPrevSibling();
}
assert lastChild != null;
if (lastChild.getNode().getElementType().equals(JetTokens.BLOCK_COMMENT)) {