aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format/website-samples
diff options
context:
space:
mode:
Diffstat (limited to 'core/testdata/format/website-samples')
-rw-r--r--core/testdata/format/website-samples/sample.kt16
-rw-r--r--core/testdata/format/website-samples/sample.md38
-rw-r--r--core/testdata/format/website-samples/sampleWithAsserts.kt15
-rw-r--r--core/testdata/format/website-samples/sampleWithAsserts.md23
4 files changed, 92 insertions, 0 deletions
diff --git a/core/testdata/format/website-samples/sample.kt b/core/testdata/format/website-samples/sample.kt
new file mode 100644
index 00000000..a664c2f5
--- /dev/null
+++ b/core/testdata/format/website-samples/sample.kt
@@ -0,0 +1,16 @@
+/**
+ * Groups elements of the original sequence by the key returned by the given [keySelector] function
+ * applied to each element and returns a map where each group key is associated with a list of corresponding elements.
+ * @sample example1
+ */
+fun foo(): Int {
+ return 0
+}
+
+fun foo(i: Int): Int {
+ return 1
+}
+
+fun example1(node: String) = if (true) {
+ println(property)
+}
diff --git a/core/testdata/format/website-samples/sample.md b/core/testdata/format/website-samples/sample.md
new file mode 100644
index 00000000..203f1b02
--- /dev/null
+++ b/core/testdata/format/website-samples/sample.md
@@ -0,0 +1,38 @@
+---
+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="overload-group" markdown="1">
+
+<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">Int</span></code></div>
+
+Groups elements of the original sequence by the key returned by the given <a href="#">keySelector</a> function
+applied to each element and returns a map where each group key is associated with a list of corresponding elements.
+
+<div class="sample" markdown="1">
+
+``` kotlin
+
+fun main(args: Array<String>) {
+//sampleStart
+if (true) {
+ println(property)
+}
+//sampleEnd
+}
+```
+
+</div>
+
+</div>
+
+<div class="overload-group" markdown="1">
+
+<div class="signature"><code><span class="keyword">fun </span><span class="identifier">foo</span><span class="symbol">(</span><span class="parameterName" id="$foo(kotlin.Int)/i">i</span><span class="symbol">:</span>&nbsp;<span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></div>
+
+</div>
diff --git a/core/testdata/format/website-samples/sampleWithAsserts.kt b/core/testdata/format/website-samples/sampleWithAsserts.kt
new file mode 100644
index 00000000..bb9732d5
--- /dev/null
+++ b/core/testdata/format/website-samples/sampleWithAsserts.kt
@@ -0,0 +1,15 @@
+/**
+ * @sample sample
+ */
+fun a(): String {
+ return "Hello, Work"
+}
+
+fun b(): String {
+ return "Hello, Rest"
+}
+
+fun sample() {
+ assertPrints(a(), "Hello, Work")
+ assertTrue(a() == b())
+} \ No newline at end of file
diff --git a/core/testdata/format/website-samples/sampleWithAsserts.md b/core/testdata/format/website-samples/sampleWithAsserts.md
new file mode 100644
index 00000000..98d7df33
--- /dev/null
+++ b/core/testdata/format/website-samples/sampleWithAsserts.md
@@ -0,0 +1,23 @@
+---
+title: a - test
+layout: api
+---
+
+<div class='api-docs-breadcrumbs'><a href="test/index">test</a> / <a href="test/a">a</a></div>
+
+# a
+
+<div class="signature"><code><span class="keyword">fun </span><span class="identifier">a</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">String</span></code></div>
+<div class="sample" markdown="1">
+
+``` kotlin
+
+fun main(args: Array<String>) {
+//sampleStart
+println(a()) // Hello, Work
+println("a() == b() is ${a() == b()}") // true
+//sampleEnd
+}
+```
+
+</div>