int (PsiFile file, int parentOffset, int childOffset, ASTNode child) { assertEquals(child.getStartOffsetInParent(), childOffset); assertEquals(child.getStartOffset(), childOffset + parentOffset); int childLength = child.getTextLength(); assertEquals(TextRange.from(childOffset + parentOffset, childLength), child.getTextRange()); if (!(child.getPsi() instanceof ForeignLeafPsiElement)) { assertEquals(child.getTextRange().substring(file.getText()), child.getText()); } return childLength; }