aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format/website-samples/newLinesInSamples.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-02-07 15:48:30 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-02-07 15:48:30 +0300
commitcf4bb4673730cc0787784380fc986efec8f8e9fb (patch)
tree223dbbd5dfb2ef459ccbabb5a39418d65bedda9a /core/testdata/format/website-samples/newLinesInSamples.kt
parentf4f7642c90fef06f04cadc57835ed431ace69802 (diff)
downloaddokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.tar.gz
dokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.tar.bz2
dokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.zip
KT-16197 WebDemo: No empty strings
#KT-16197 fixed
Diffstat (limited to 'core/testdata/format/website-samples/newLinesInSamples.kt')
-rw-r--r--core/testdata/format/website-samples/newLinesInSamples.kt19
1 files changed, 19 insertions, 0 deletions
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