diff options
| author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-09-14 13:49:54 +0200 |
|---|---|---|
| committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-07 02:36:57 +0200 |
| commit | ec637955575995011351b106d3a67194d21c4b15 (patch) | |
| tree | 5762d6ca0c49cc48dec01240380bc6fd436e81b0 /plugins/base/src/test/kotlin/model | |
| parent | 7c4301a48af55e156538666b6e645d8d13caae9a (diff) | |
| download | dokka-ec637955575995011351b106d3a67194d21c4b15.tar.gz dokka-ec637955575995011351b106d3a67194d21c4b15.tar.bz2 dokka-ec637955575995011351b106d3a67194d21c4b15.zip | |
Introduce top-level DocTag
Diffstat (limited to 'plugins/base/src/test/kotlin/model')
| -rw-r--r-- | plugins/base/src/test/kotlin/model/CommentTest.kt | 36 | ||||
| -rw-r--r-- | plugins/base/src/test/kotlin/model/FunctionsTest.kt | 6 | ||||
| -rw-r--r-- | plugins/base/src/test/kotlin/model/JavaTest.kt | 2 |
3 files changed, 25 insertions, 19 deletions
diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt index c1da8ee0..613576ae 100644 --- a/plugins/base/src/test/kotlin/model/CommentTest.kt +++ b/plugins/base/src/test/kotlin/model/CommentTest.kt @@ -30,16 +30,21 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme ) { with((this / "comment" / "prop1").cast<DProperty>()) { name equals "prop1" - with(this.docs().firstOrNull()?.root.assertNotNull("Code")) { - (children.firstOrNull() as? Text) + with(this.docs().firstOrNull()?.children?.firstOrNull()?.assertNotNull("Code")) { + (this?.children?.firstOrNull() as? Text) ?.body equals "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." - params["lang"] equals "brainfuck" + this?.params?.get("lang") equals "brainfuck" } } with((this / "comment" / "prop2").cast<DProperty>()) { name equals "prop2" - comments() equals "a + b - c" + with(this.docs().firstOrNull()?.children?.firstOrNull()?.assertNotNull("Code")) { + (this?.children?.firstOrNull() as? Text) + ?.body equals "a + b - c" + + this?.params?.get("lang") equals null + } } } } @@ -88,7 +93,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "doc1\ndoc2 doc3" + comments() equals "doc1\ndoc2 doc3\n" } } } @@ -108,7 +113,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "doc1\ndoc2 doc3" + comments() equals "doc1\ndoc2 doc3\n" } } } @@ -122,7 +127,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "doc" + comments() equals "doc\n" } } } @@ -137,7 +142,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "doc" + comments() equals "doc\n" } } } @@ -152,7 +157,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "doc" + comments() equals "doc\n" } } } @@ -169,7 +174,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "Summary\none: []" + comments() equals "Summary\n\none: []" docs().find { it is CustomTagWrapper && it.name == "one" }.let { with(it.assertNotNull("'one' entry")) { root.children counts 0 @@ -189,7 +194,8 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals """it's "useful"""" + comments() equals """it's "useful" +""" } } } @@ -206,7 +212,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "Summary\none: [section one]" + comments() equals "Summary\n\none: [section one\n]" } } } @@ -225,7 +231,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "Summary\none: [section one]\ntwo: [section two]" + comments() equals "Summary\n\none: [section one\n]\ntwo: [section two\n]" } } } @@ -244,7 +250,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { with((this / "comment" / "property").cast<DProperty>()) { - comments() equals "Summary\none: [line one line two]" + comments() equals "Summary\n\none: [line one line two\n]" } } } @@ -329,4 +335,4 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme // } // } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index c96e7df6..9fffb4fc 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -118,14 +118,14 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun """ ) { with((this / "function" / "function").cast<DFunction>()) { - comments() equals "Multiline\nFunction Documentation" + comments() equals "Multiline\nFunction Documentation\n" name equals "function" parameters counts 1 parameters.firstOrNull().assertNotNull("Parameter: ").also { it.name equals "x" it.type.name equals "Int" - it.comments() equals "parameter" + it.comments() equals "parameter\n" } type.assertNotNull("Return type: ").name equals "Unit" @@ -393,4 +393,4 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 4e9b9de4..51d7556c 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -34,7 +34,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { with((this / "fn").cast<DFunction>()) { name equals "fn" val params = parameters.map { it.documentation.values.first().children.first() as Param } - params.mapNotNull { it.firstChildOfTypeOrNull<Text>()?.body } equals listOf("is String parameter", "is int parameter") + params.mapNotNull { it.firstMemberOfType<Text>()?.body } equals listOf("is String parameter", "is int parameter") } } } |
