diff --git a/idea/testData/debugger/sequence/exec/sequence/outs/flatMap.out b/idea/testData/debugger/sequence/exec/sequence/outs/flatMap.out new file mode 100644 index 00000000000..2830fe6a083 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/sequence/outs/flatMap.out @@ -0,0 +1,32 @@ +LineBreakpoint created at FlatMap.kt:5 +Run Java +Connected to the target VM +FlatMap.kt:5 +listOf(1, 0, 2).asSequence() +.flatMap({ (0 until it).asSequence() }) +.count() +flatMap + before: 1,3,4 + after: 2,5,6 +count + before: 2,5,6 + after: nothing +mappings for flatMap + direct: + 1 -> 2 + 3 -> nothing + 4 -> 5,6 + reverse: + 1 <- 2 + 4 <- 5 + 4 <- 6 +mappings for count + direct: + 2 -> nothing + 5 -> nothing + 6 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/sequence/outs/flatten.out b/idea/testData/debugger/sequence/exec/sequence/outs/flatten.out new file mode 100644 index 00000000000..abfcd13ddba --- /dev/null +++ b/idea/testData/debugger/sequence/exec/sequence/outs/flatten.out @@ -0,0 +1,38 @@ +LineBreakpoint created at Flatten.kt:5 +Run Java +Connected to the target VM +Flatten.kt:5 +listOf(listOf(1,2,3), listOf(), listOf(4,5,6)).asSequence() +.flatten() +.toList() +flatten + before: 1,5,6 + after: 2,3,4,7,8,9 +toList + before: 2,3,4,7,8,9 + after: nothing +mappings for flatten + direct: + 1 -> 2,3,4 + 5 -> nothing + 6 -> 7,8,9 + reverse: + 1 <- 2 + 1 <- 3 + 1 <- 4 + 6 <- 7 + 6 <- 8 + 6 <- 9 +mappings for toList + direct: + 2 -> nothing + 3 -> nothing + 4 -> nothing + 7 -> nothing + 8 -> nothing + 9 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/sequence/src/flatMap/FlatMap.kt b/idea/testData/debugger/sequence/exec/sequence/src/flatMap/FlatMap.kt new file mode 100644 index 00000000000..dad59f5fb7e --- /dev/null +++ b/idea/testData/debugger/sequence/exec/sequence/src/flatMap/FlatMap.kt @@ -0,0 +1,6 @@ +package flatMap + +fun main(args: Array) { + // Breakpoint! + listOf(1, 0, 2).asSequence().flatMap { (0 until it).asSequence() }.count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/exec/sequence/src/flatMap/Flatten.kt b/idea/testData/debugger/sequence/exec/sequence/src/flatMap/Flatten.kt new file mode 100644 index 00000000000..f7504786ef1 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/sequence/src/flatMap/Flatten.kt @@ -0,0 +1,6 @@ +package flatMap + +fun main(args: Array) { + // Breakpoint! + listOf(listOf(1,2,3), listOf(), listOf(4,5,6)).asSequence().flatten().toList() +} \ No newline at end of file diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/FlatMapOperationsTest.kt b/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/FlatMapOperationsTest.kt new file mode 100644 index 00000000000..0b5af99a6c9 --- /dev/null +++ b/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/FlatMapOperationsTest.kt @@ -0,0 +1,10 @@ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.debugger.streams.kotlin.exec.sequence + +/** + * @author Vitaliy.Bibaev + */ +class FlatMapOperationsTest : OperationsTestCase("flatMap") { + fun testFlatMap() = doTestWithResult() + fun testFlatten() = doTestWithResult() +} \ No newline at end of file