aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format/website-html/newLinesInSamples.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/testdata/format/website-html/newLinesInSamples.kt')
-rw-r--r--core/testdata/format/website-html/newLinesInSamples.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/testdata/format/website-html/newLinesInSamples.kt b/core/testdata/format/website-html/newLinesInSamples.kt
new file mode 100644
index 000000000..ee49aefc7
--- /dev/null
+++ b/core/testdata/format/website-html/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