aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/markdown/ParserTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/markdown/ParserTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/markdown/ParserTest.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
index 41b086ee..e10a2260 100644
--- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
@@ -1473,6 +1473,7 @@ class ParserTest : KDocTest() {
executeTest(kdoc, expectedDocumentationNode)
}
+
@Test
fun `exception thrown by empty header should point to location of a file`() {
val kdoc = """
@@ -1481,9 +1482,10 @@ class ParserTest : KDocTest() {
val expectedDocumentationNode = DocumentationNode(emptyList())
val exception = runCatching { executeTest(kdoc, expectedDocumentationNode) }.exceptionOrNull()
- assertEquals(
- "Wrong AST Tree. Header does not contain expected content in Test.kt/example.Test, element starts from offset 0 and ends 3: ###",
- exception?.message
+ val expectedMessage = "Wrong AST Tree. Header does not contain expected content in Test.kt/example.Test, element starts from offset 0 and ends 3: ###"
+ assert(
+ exception?.message == expectedMessage
+ || /* for K2 */ exception?.cause?.cause?.message == expectedMessage
)
}