aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 16:05:59 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 16:05:59 +0400
commit372ab94571e1ad5885982ea83d4b55286f1d6c23 (patch)
treeff8b4d3d1261da88515f528bc3a7aa083f7dbfb4 /test
parent52deaf7d9b31a4cc5ed36a280e07fdfeff975362 (diff)
downloaddokka-372ab94571e1ad5885982ea83d4b55286f1d6c23.tar.gz
dokka-372ab94571e1ad5885982ea83d4b55286f1d6c23.tar.bz2
dokka-372ab94571e1ad5885982ea83d4b55286f1d6c23.zip
Implement KotlinSignatureGenerator to render nodes back into text in Kotlin syntax.
Diffstat (limited to 'test')
-rw-r--r--test/data/packages/simpleNamePackage2.kt1
-rw-r--r--test/playground.kt18
-rw-r--r--test/src/model/PackageTest.kt24
3 files changed, 37 insertions, 6 deletions
diff --git a/test/data/packages/simpleNamePackage2.kt b/test/data/packages/simpleNamePackage2.kt
new file mode 100644
index 00000000..2c29f4c7
--- /dev/null
+++ b/test/data/packages/simpleNamePackage2.kt
@@ -0,0 +1 @@
+package simple
diff --git a/test/playground.kt b/test/playground.kt
index dc2713c7..ca503791 100644
--- a/test/playground.kt
+++ b/test/playground.kt
@@ -29,10 +29,11 @@ class Class {
* This is a class with constructor and space after doc
*/
-class ClassWithConstructor(/** Doc at parameter */ val name: Class)
+class ClassWithConstructor(
+ /** Doc at parameter */ val name: Class)
/**
- * This is data class $Person with constructor and two properties
+ * This is data class with constructor and two properties
*
* $name Person's name
* $age Person's age
@@ -46,7 +47,7 @@ object Object {
}
val objectValue: String
- /** one line getter doc */
+ /** one line getter doc */
get() = "Member"
}
@@ -54,15 +55,20 @@ object Object {
class OuterClass {
/**
- * $T: type of the item
+ * $T type of the item
*/
class NestedClass<T> {
- fun nestedClassFunction() {
+ fun nestedClassFunction(item: T) {
}
}
inner class InnerClass {
- fun innerClassFunction() {
+ fun innerClassFunction<
+ /** doc for R1 type param */
+ R1,
+ /** doc for R2 type param */
+ R2,
+ >() {
}
}
diff --git a/test/src/model/PackageTest.kt b/test/src/model/PackageTest.kt
index 8fda37ea..aa4bd088 100644
--- a/test/src/model/PackageTest.kt
+++ b/test/src/model/PackageTest.kt
@@ -65,4 +65,28 @@ public class PackageTest {
}
}
}
+
+ Test fun multipleFilesSamePackage() {
+ verifyModel("test/data/packages/simpleNamePackage.kt", "test/data/packages/simpleNamePackage2.kt") { model ->
+ assertEquals(2, model.members.count())
+ with(model.members.elementAt(0)) {
+ assertEquals(DocumentationNode.Kind.Package, kind)
+ assertEquals("simple", name)
+ assertEquals(DocumentationContent.Empty, doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ // TODO: Looks like package fragments should be merged into package view in the model
+ // and here should be single member
+ with(model.members.elementAt(1)) {
+ assertEquals(DocumentationNode.Kind.Package, kind)
+ assertEquals("simple", name)
+ assertEquals(DocumentationContent.Empty, doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
} \ No newline at end of file