diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/TagsTestDataUtil.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/TagsTestDataUtil.java index 161d5b178b9..ade11725064 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/TagsTestDataUtil.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/TagsTestDataUtil.java @@ -68,11 +68,12 @@ public class TagsTestDataUtil { String tagText; if (point.isStart) { String attributesString = point.getAttributesString(); + String closeSuffix = point.isClosed ? "/" : ""; if (attributesString.isEmpty()) { - tagText = String.format("<%s>", point.getName()); + tagText = String.format("<%s%s>", point.getName(), closeSuffix); } else { - tagText = String.format("<%s %s>", point.getName(), attributesString); + tagText = String.format("<%s %s%s>", point.getName(), attributesString, closeSuffix); } } else { @@ -88,11 +89,23 @@ public class TagsTestDataUtil { public static class TagInfo implements Comparable> { protected final int offset; protected final boolean isStart; + protected final boolean isClosed; + protected final boolean isFixed; protected final Data data; public TagInfo(int offset, boolean start, Data data) { + this(offset, start, false, false, data); + } + + public TagInfo(int offset, boolean isStart, boolean isClosed, boolean isFixed, Data data) { + if (isClosed && !isStart) { + throw new IllegalArgumentException("isClosed should be true only for start tags"); + } + this.offset = offset; - isStart = start; + this.isStart = isStart; + this.isClosed = isClosed; + this.isFixed = isFixed; this.data = data; } @@ -107,6 +120,10 @@ public class TagsTestDataUtil { return isStart ? -1 : 1; } + if (isFixed || other.isFixed) { + return 0; + } + String thisTag = this.getName(); String otherTag = other.getName();