aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format
diff options
context:
space:
mode:
Diffstat (limited to 'core/testdata/format')
-rw-r--r--core/testdata/format/dynamicExtension.kt3
-rw-r--r--core/testdata/format/dynamicExtension.md10
-rw-r--r--core/testdata/format/dynamicType.kt2
-rw-r--r--core/testdata/format/dynamicType.md5
-rw-r--r--core/testdata/format/memberExtension.kt8
-rw-r--r--core/testdata/format/memberExtension.md10
-rw-r--r--core/testdata/format/multiplatform/js.kt7
-rw-r--r--core/testdata/format/multiplatform/jvm.kt8
-rw-r--r--core/testdata/format/multiplatform/multiplatform.package.md9
-rw-r--r--core/testdata/format/multiplatformImplied/foo.md24
-rw-r--r--core/testdata/format/multiplatformImplied/js.kt16
-rw-r--r--core/testdata/format/multiplatformImplied/jvm.kt16
-rw-r--r--core/testdata/format/multiplatformMerge/js.kt7
-rw-r--r--core/testdata/format/multiplatformMerge/jvm.kt8
-rw-r--r--core/testdata/format/multiplatformMerge/multiplatform.package.md8
-rw-r--r--core/testdata/format/multiplatformMergeMembers/foo.md26
-rw-r--r--core/testdata/format/multiplatformMergeMembers/js.kt16
-rw-r--r--core/testdata/format/multiplatformMergeMembers/jvm.kt16
-rw-r--r--core/testdata/format/multiplatformOmitRedundant/foo.md22
-rw-r--r--core/testdata/format/multiplatformOmitRedundant/js.kt2
-rw-r--r--core/testdata/format/multiplatformOmitRedundant/jvm.kt11
-rw-r--r--core/testdata/format/sinceKotlin.html27
-rw-r--r--core/testdata/format/sinceKotlin.kt5
-rw-r--r--core/testdata/format/sinceKotlin.md14
-rw-r--r--core/testdata/format/sinceKotlin.package.md8
-rw-r--r--core/testdata/format/website-samples/dropImport.md1
-rw-r--r--core/testdata/format/website-samples/newLinesInSamples.kt19
-rw-r--r--core/testdata/format/website-samples/newLinesInSamples.md31
-rw-r--r--core/testdata/format/website-samples/sample.md1
-rw-r--r--core/testdata/format/website-samples/sampleWithAsserts.md1
30 files changed, 341 insertions, 0 deletions
diff --git a/core/testdata/format/dynamicExtension.kt b/core/testdata/format/dynamicExtension.kt
new file mode 100644
index 00000000..5c83bf22
--- /dev/null
+++ b/core/testdata/format/dynamicExtension.kt
@@ -0,0 +1,3 @@
+class Foo
+
+fun dynamic.bar() {}
diff --git a/core/testdata/format/dynamicExtension.md b/core/testdata/format/dynamicExtension.md
new file mode 100644
index 00000000..2fd928f6
--- /dev/null
+++ b/core/testdata/format/dynamicExtension.md
@@ -0,0 +1,10 @@
+[test](test/index) / [Foo](test/-foo/index)
+
+# Foo
+
+`class Foo`
+
+### Constructors
+
+| [<init>](test/-foo/-init-) | `Foo()` |
+
diff --git a/core/testdata/format/dynamicType.kt b/core/testdata/format/dynamicType.kt
new file mode 100644
index 00000000..9d557ac0
--- /dev/null
+++ b/core/testdata/format/dynamicType.kt
@@ -0,0 +1,2 @@
+fun foo(): dynamic = ""
+
diff --git a/core/testdata/format/dynamicType.md b/core/testdata/format/dynamicType.md
new file mode 100644
index 00000000..a3d6696b
--- /dev/null
+++ b/core/testdata/format/dynamicType.md
@@ -0,0 +1,5 @@
+[test](test/index) / [foo](test/foo)
+
+# foo
+
+`fun foo(): dynamic` \ No newline at end of file
diff --git a/core/testdata/format/memberExtension.kt b/core/testdata/format/memberExtension.kt
new file mode 100644
index 00000000..955794d1
--- /dev/null
+++ b/core/testdata/format/memberExtension.kt
@@ -0,0 +1,8 @@
+open class X
+
+class Foo : X
+
+class Bar {
+ fun X.y() = ""
+ fun Foo.x() = ""
+}
diff --git a/core/testdata/format/memberExtension.md b/core/testdata/format/memberExtension.md
new file mode 100644
index 00000000..b9db4e3d
--- /dev/null
+++ b/core/testdata/format/memberExtension.md
@@ -0,0 +1,10 @@
+[test](test/index) / [Foo](test/-foo/index)
+
+# Foo
+
+`class Foo : `[`X`](test/-x/index)
+
+### Constructors
+
+| [<init>](test/-foo/-init-) | `Foo()` |
+
diff --git a/core/testdata/format/multiplatform/js.kt b/core/testdata/format/multiplatform/js.kt
new file mode 100644
index 00000000..e6d66ffd
--- /dev/null
+++ b/core/testdata/format/multiplatform/js.kt
@@ -0,0 +1,7 @@
+package foo
+
+/**
+ * This is a bar.
+ */
+class Bar {
+}
diff --git a/core/testdata/format/multiplatform/jvm.kt b/core/testdata/format/multiplatform/jvm.kt
new file mode 100644
index 00000000..cb77273f
--- /dev/null
+++ b/core/testdata/format/multiplatform/jvm.kt
@@ -0,0 +1,8 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+
+}
diff --git a/core/testdata/format/multiplatform/multiplatform.package.md b/core/testdata/format/multiplatform/multiplatform.package.md
new file mode 100644
index 00000000..3574942c
--- /dev/null
+++ b/core/testdata/format/multiplatform/multiplatform.package.md
@@ -0,0 +1,9 @@
+[test](test/index) / [foo](test/foo/index)
+
+## Package foo
+
+### Types
+
+| [Bar](test/foo/-bar/index)<br>(JS) | `class Bar`<br>This is a bar. |
+| [Foo](test/foo/-foo/index)<br>(JVM) | `class Foo`<br>This is a foo. |
+
diff --git a/core/testdata/format/multiplatformImplied/foo.md b/core/testdata/format/multiplatformImplied/foo.md
new file mode 100644
index 00000000..c615dd8e
--- /dev/null
+++ b/core/testdata/format/multiplatformImplied/foo.md
@@ -0,0 +1,24 @@
+[test](test/index) / [foo](test/foo/index) / [Foo](test/foo/-foo/index)
+
+# Foo
+
+`class Foo`
+
+This is a foo.
+
+### Constructors
+
+| [&lt;init&gt;](test/foo/-foo/-init-) | `Foo()`<br>This is a foo. |
+
+### Properties
+
+| [propJs](test/foo/-foo/prop-js)<br>(JS) | `val propJs: String` |
+| [propJvm](test/foo/-foo/prop-jvm)<br>(JVM) | `val propJvm: String` |
+| [propJvmAndJs](test/foo/-foo/prop-jvm-and-js) | `val propJvmAndJs: Int` |
+
+### Functions
+
+| [bothJvmAndJs](test/foo/-foo/both-jvm-and-js) | `fun bothJvmAndJs(): Unit` |
+| [js](test/foo/-foo/js)<br>(JS) | `fun js(): Unit` |
+| [jvm](test/foo/-foo/jvm)<br>(JVM) | `fun jvm(): Unit` |
+
diff --git a/core/testdata/format/multiplatformImplied/js.kt b/core/testdata/format/multiplatformImplied/js.kt
new file mode 100644
index 00000000..dd2de5bc
--- /dev/null
+++ b/core/testdata/format/multiplatformImplied/js.kt
@@ -0,0 +1,16 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+ fun bothJvmAndJs() {
+ }
+
+ fun js() {
+ }
+
+ val propJvmAndJs = 0
+
+ val propJs = "abc"
+}
diff --git a/core/testdata/format/multiplatformImplied/jvm.kt b/core/testdata/format/multiplatformImplied/jvm.kt
new file mode 100644
index 00000000..8d73ce25
--- /dev/null
+++ b/core/testdata/format/multiplatformImplied/jvm.kt
@@ -0,0 +1,16 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+ fun bothJvmAndJs() {
+ }
+
+ fun jvm() {
+ }
+
+ val propJvmAndJs = 0
+
+ val propJvm = "abc"
+}
diff --git a/core/testdata/format/multiplatformMerge/js.kt b/core/testdata/format/multiplatformMerge/js.kt
new file mode 100644
index 00000000..bbf1dd7c
--- /dev/null
+++ b/core/testdata/format/multiplatformMerge/js.kt
@@ -0,0 +1,7 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+}
diff --git a/core/testdata/format/multiplatformMerge/jvm.kt b/core/testdata/format/multiplatformMerge/jvm.kt
new file mode 100644
index 00000000..cb77273f
--- /dev/null
+++ b/core/testdata/format/multiplatformMerge/jvm.kt
@@ -0,0 +1,8 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+
+}
diff --git a/core/testdata/format/multiplatformMerge/multiplatform.package.md b/core/testdata/format/multiplatformMerge/multiplatform.package.md
new file mode 100644
index 00000000..a423f603
--- /dev/null
+++ b/core/testdata/format/multiplatformMerge/multiplatform.package.md
@@ -0,0 +1,8 @@
+[test](test/index) / [foo](test/foo/index)
+
+## Package foo
+
+### Types
+
+| [Foo](test/foo/-foo/index)<br>(JVM, JS) | `class Foo`<br>This is a foo. |
+
diff --git a/core/testdata/format/multiplatformMergeMembers/foo.md b/core/testdata/format/multiplatformMergeMembers/foo.md
new file mode 100644
index 00000000..7490c878
--- /dev/null
+++ b/core/testdata/format/multiplatformMergeMembers/foo.md
@@ -0,0 +1,26 @@
+[test](test/index) / [foo](test/foo/index) / [Foo](test/foo/-foo/index)
+
+# Foo
+
+`class Foo`
+
+**Platform and version requirements:** JVM, JS
+
+This is a foo.
+
+### Constructors
+
+| [&lt;init&gt;](test/foo/-foo/-init-) | `Foo()`<br>This is a foo. |
+
+### Properties
+
+| [propJs](test/foo/-foo/prop-js)<br>(JS) | `val propJs: String` |
+| [propJvm](test/foo/-foo/prop-jvm)<br>(JVM) | `val propJvm: String` |
+| [propJvmAndJs](test/foo/-foo/prop-jvm-and-js) | `val propJvmAndJs: Int` |
+
+### Functions
+
+| [bothJvmAndJs](test/foo/-foo/both-jvm-and-js) | `fun bothJvmAndJs(): Unit` |
+| [js](test/foo/-foo/js)<br>(JS) | `fun js(): Unit` |
+| [jvm](test/foo/-foo/jvm)<br>(JVM) | `fun jvm(): Unit` |
+
diff --git a/core/testdata/format/multiplatformMergeMembers/js.kt b/core/testdata/format/multiplatformMergeMembers/js.kt
new file mode 100644
index 00000000..dd2de5bc
--- /dev/null
+++ b/core/testdata/format/multiplatformMergeMembers/js.kt
@@ -0,0 +1,16 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+ fun bothJvmAndJs() {
+ }
+
+ fun js() {
+ }
+
+ val propJvmAndJs = 0
+
+ val propJs = "abc"
+}
diff --git a/core/testdata/format/multiplatformMergeMembers/jvm.kt b/core/testdata/format/multiplatformMergeMembers/jvm.kt
new file mode 100644
index 00000000..8d73ce25
--- /dev/null
+++ b/core/testdata/format/multiplatformMergeMembers/jvm.kt
@@ -0,0 +1,16 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+ fun bothJvmAndJs() {
+ }
+
+ fun jvm() {
+ }
+
+ val propJvmAndJs = 0
+
+ val propJvm = "abc"
+}
diff --git a/core/testdata/format/multiplatformOmitRedundant/foo.md b/core/testdata/format/multiplatformOmitRedundant/foo.md
new file mode 100644
index 00000000..088ced2c
--- /dev/null
+++ b/core/testdata/format/multiplatformOmitRedundant/foo.md
@@ -0,0 +1,22 @@
+[test](test/index) / [foo](test/foo/index) / [Foo](test/foo/-foo/index)
+
+# Foo
+
+`class Foo`
+
+**Platform and version requirements:** JVM
+
+This is a foo.
+
+### Constructors
+
+| [&lt;init&gt;](test/foo/-foo/-init-) | `Foo()`<br>This is a foo. |
+
+### Properties
+
+| [propJvm](test/foo/-foo/prop-jvm) | `val propJvm: String` |
+
+### Functions
+
+| [jvm](test/foo/-foo/jvm) | `fun jvm(): Unit` |
+
diff --git a/core/testdata/format/multiplatformOmitRedundant/js.kt b/core/testdata/format/multiplatformOmitRedundant/js.kt
new file mode 100644
index 00000000..d1b1429c
--- /dev/null
+++ b/core/testdata/format/multiplatformOmitRedundant/js.kt
@@ -0,0 +1,2 @@
+package foo
+
diff --git a/core/testdata/format/multiplatformOmitRedundant/jvm.kt b/core/testdata/format/multiplatformOmitRedundant/jvm.kt
new file mode 100644
index 00000000..35e3c08d
--- /dev/null
+++ b/core/testdata/format/multiplatformOmitRedundant/jvm.kt
@@ -0,0 +1,11 @@
+package foo
+
+/**
+ * This is a foo.
+ */
+class Foo {
+ fun jvm() {
+ }
+
+ val propJvm = "abc"
+}
diff --git a/core/testdata/format/sinceKotlin.html b/core/testdata/format/sinceKotlin.html
new file mode 100644
index 00000000..eef5ca66
--- /dev/null
+++ b/core/testdata/format/sinceKotlin.html
@@ -0,0 +1,27 @@
+<HTML>
+<HEAD>
+ <meta charset="UTF-8">
+ <title>Since1.1 - test</title>
+</HEAD>
+<BODY>
+<a href="test/index">test</a>&nbsp;/&nbsp;<a href="test/-since1.1/index">Since1.1</a><br/>
+<br/>
+<h1>Since1.1</h1>
+<code><span class="keyword">class </span><span class="identifier">Since1.1</span></code>
+<p><strong>Platform and version requirements:</strong> Kotlin 1.1</p>
+<p>Useful</p>
+<h3>Constructors</h3>
+<table>
+ <tbody>
+ <tr>
+ <td>
+ <a href="test/-since1.1/-init-">&lt;init&gt;</a></td>
+ <td>
+ <code><span class="identifier">Since1.1</span><span class="symbol">(</span><span class="symbol">)</span></code>
+ <p>Useful</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</BODY>
+</HTML>
diff --git a/core/testdata/format/sinceKotlin.kt b/core/testdata/format/sinceKotlin.kt
new file mode 100644
index 00000000..1025cf0d
--- /dev/null
+++ b/core/testdata/format/sinceKotlin.kt
@@ -0,0 +1,5 @@
+/**
+ * Useful
+ */
+@SinceKotlin("1.1")
+class `Since1.1` \ No newline at end of file
diff --git a/core/testdata/format/sinceKotlin.md b/core/testdata/format/sinceKotlin.md
new file mode 100644
index 00000000..a1abe5fd
--- /dev/null
+++ b/core/testdata/format/sinceKotlin.md
@@ -0,0 +1,14 @@
+[test](test/index) / [Since1.1](test/-since1.1/index)
+
+# Since1.1
+
+`class Since1.1`
+
+**Platform and version requirements:** Kotlin 1.1
+
+Useful
+
+### Constructors
+
+| [&lt;init&gt;](test/-since1.1/-init-) | `Since1.1()`<br>Useful |
+
diff --git a/core/testdata/format/sinceKotlin.package.md b/core/testdata/format/sinceKotlin.package.md
new file mode 100644
index 00000000..2af0c9ee
--- /dev/null
+++ b/core/testdata/format/sinceKotlin.package.md
@@ -0,0 +1,8 @@
+[test](test/index)
+
+## Package &lt;root&gt;
+
+### Types
+
+| [Since1.1](test/-since1.1/index)<br>(Kotlin 1.1) | `class Since1.1`<br>Useful |
+
diff --git a/core/testdata/format/website-samples/dropImport.md b/core/testdata/format/website-samples/dropImport.md
index 13c8fb79..1e05678b 100644
--- a/core/testdata/format/website-samples/dropImport.md
+++ b/core/testdata/format/website-samples/dropImport.md
@@ -12,6 +12,7 @@ layout: api
``` kotlin
import some.*
+
fun main(args: Array<String>) {
//sampleStart
diff --git a/core/testdata/format/website-samples/newLinesInSamples.kt b/core/testdata/format/website-samples/newLinesInSamples.kt
new file mode 100644
index 00000000..ee49aefc
--- /dev/null
+++ b/core/testdata/format/website-samples/newLinesInSamples.kt
@@ -0,0 +1,19 @@
+fun groupBySample() {
+ val words = listOf("a", "abc", "ab", "def", "abcd")
+ val byLength = words.groupBy { it.length }
+
+ assertPrints(byLength.keys, "[1, 3, 2, 4]")
+ assertPrints(byLength.values, "[[a], [abc, def], [ab], [abcd]]")
+
+ val mutableByLength: MutableMap<Int, MutableList<String>> = words.groupByTo(mutableMapOf()) { it.length }
+ // same content as in byLength map, but the map is mutable
+ assertTrue(mutableByLength == byLength)
+}
+
+
+/**
+ * @sample groupBySample
+ */
+fun foo() {
+
+} \ No newline at end of file
diff --git a/core/testdata/format/website-samples/newLinesInSamples.md b/core/testdata/format/website-samples/newLinesInSamples.md
new file mode 100644
index 00000000..5344b983
--- /dev/null
+++ b/core/testdata/format/website-samples/newLinesInSamples.md
@@ -0,0 +1,31 @@
+---
+title: foo - test
+layout: api
+---
+
+<div class='api-docs-breadcrumbs'><a href="test/index">test</a> / <a href="test/foo">foo</a></div>
+
+# foo
+
+<div class="signature"><code><span class="keyword">fun </span><span class="identifier">foo</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></div>
+<div class="sample" markdown="1">
+
+``` kotlin
+
+
+fun main(args: Array<String>) {
+//sampleStart
+val words = listOf("a", "abc", "ab", "def", "abcd")
+val byLength = words.groupBy { it.length }
+
+println(byLength.keys) // [1, 3, 2, 4]
+println(byLength.values) // [[a], [abc, def], [ab], [abcd]]
+
+val mutableByLength: MutableMap<Int, MutableList<String>> = words.groupByTo(mutableMapOf()) { it.length }
+// same content as in byLength map, but the map is mutable
+println("mutableByLength == byLength is ${mutableByLength == byLength}") // true
+//sampleEnd
+}
+```
+
+</div>
diff --git a/core/testdata/format/website-samples/sample.md b/core/testdata/format/website-samples/sample.md
index 203f1b02..b29075a7 100644
--- a/core/testdata/format/website-samples/sample.md
+++ b/core/testdata/format/website-samples/sample.md
@@ -18,6 +18,7 @@ applied to each element and returns a map where each group key is associated wit
``` kotlin
+
fun main(args: Array<String>) {
//sampleStart
if (true) {
diff --git a/core/testdata/format/website-samples/sampleWithAsserts.md b/core/testdata/format/website-samples/sampleWithAsserts.md
index 98d7df33..c114468a 100644
--- a/core/testdata/format/website-samples/sampleWithAsserts.md
+++ b/core/testdata/format/website-samples/sampleWithAsserts.md
@@ -12,6 +12,7 @@ layout: api
``` kotlin
+
fun main(args: Array<String>) {
//sampleStart
println(a()) // Hello, Work