From cf4bb4673730cc0787784380fc986efec8f8e9fb Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 7 Feb 2017 15:48:30 +0300 Subject: KT-16197 WebDemo: No empty strings #KT-16197 fixed --- .../format/website-samples/newLinesInSamples.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 core/testdata/format/website-samples/newLinesInSamples.kt (limited to 'core/testdata/format/website-samples/newLinesInSamples.kt') 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> = 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 -- cgit