diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/FewTransitions.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/FewTransitions.kt new file mode 100644 index 00000000000..a0a7f76d5ba --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/FewTransitions.kt @@ -0,0 +1,10 @@ +import java.util.stream.Stream + +fun main(args: Array) { + Stream.of(1, 2, 3) + .mapToInt { it } + .mapToObj({ it.toString() }) + .mapToLong { it.toLong() } + .mapToDouble { it / 10.0 } + .count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/MapPrimitiveToPrimitive.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/MapPrimitiveToPrimitive.kt new file mode 100644 index 00000000000..fb0b900f85c --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/MapPrimitiveToPrimitive.kt @@ -0,0 +1,5 @@ +import java.util.stream.LongStream + +fun main(args: Array) { + LongStream.of(1, 2, 3).mapToInt { it.toInt() }.count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/MapToObj.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToObj.kt new file mode 100644 index 00000000000..d55a6d40646 --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToObj.kt @@ -0,0 +1,5 @@ +import java.util.stream.DoubleStream + +fun main(args: Array) { + DoubleStream.of(2.3, 3.4, 5.6).boxed().count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/MapToPrimitive.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToPrimitive.kt new file mode 100644 index 00000000000..286448604cc --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToPrimitive.kt @@ -0,0 +1,5 @@ +import java.util.stream.LongStream + +fun main(args: Array) { + LongStream.of(10, 200, 3000).mapToDouble { it * 1000.1 }.count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/MapToSame.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToSame.kt new file mode 100644 index 00000000000..df9c9891e98 --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/MapToSame.kt @@ -0,0 +1,5 @@ +import java.util.stream.Stream + +fun main(args: Array) { + Stream.of(Any()).map({ 5 }).count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/OneCall.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/OneCall.kt new file mode 100644 index 00000000000..b77f0aa13c9 --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/OneCall.kt @@ -0,0 +1,5 @@ +import java.util.stream.Stream + +fun main(args: Array) { + Stream.of(1,2,3).count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveMapToSame.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveMapToSame.kt new file mode 100644 index 00000000000..3c357156e07 --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveMapToSame.kt @@ -0,0 +1,5 @@ +import java.util.stream.LongStream + +fun main(args: Array) { + LongStream.of(1, 2, 3).flatMap { LongStream.range(0, 10) }.count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveOneCall.kt b/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveOneCall.kt new file mode 100644 index 00000000000..32bdad6be8e --- /dev/null +++ b/idea/testData/debugger/sequence/psi/streams/positive/types/PrimitiveOneCall.kt @@ -0,0 +1,5 @@ +import java.util.stream.IntStream + +fun main(args: Array) { + IntStream.of(1, 3, 4).count() +} \ No newline at end of file diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/TypedJavaChainTest.kt b/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/TypedJavaChainTest.kt index 02b9ed6bf16..91277152649 100644 --- a/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/TypedJavaChainTest.kt +++ b/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/TypedJavaChainTest.kt @@ -1,12 +1,27 @@ package com.intellij.debugger.streams.kotlin.psi.java +import com.intellij.debugger.streams.kotlin.lib.JavaStandardLibrarySupportProvider import com.intellij.debugger.streams.kotlin.psi.TypedChainTestCase -import com.intellij.debugger.streams.lib.impl.StandardLibrarySupportProvider +import com.intellij.debugger.streams.kotlin.trace.dsl.KotlinTypes.DOUBLE +import com.intellij.debugger.streams.kotlin.trace.dsl.KotlinTypes.INT +import com.intellij.debugger.streams.kotlin.trace.dsl.KotlinTypes.LONG +import com.intellij.debugger.streams.kotlin.trace.dsl.KotlinTypes.NULLABLE_ANY import com.intellij.debugger.streams.wrapper.StreamChainBuilder /** * @author Vitaliy.Bibaev */ class TypedJavaChainTest : TypedChainTestCase("streams/positive/types") { - override val kotlinChainBuilder: StreamChainBuilder = StandardLibrarySupportProvider().chainBuilder -} \ No newline at end of file + override val kotlinChainBuilder: StreamChainBuilder = JavaStandardLibrarySupportProvider().chainBuilder + + fun testOneCall() = doTest(NULLABLE_ANY) + fun testMapToSame() = doTest(NULLABLE_ANY, NULLABLE_ANY) + fun testPrimitiveOneCall() = doTest(INT) + fun testPrimitiveMapToSame() = doTest(LONG, LONG) + + fun testMapToPrimitive() = doTest(NULLABLE_ANY, INT) + fun testMapToObj() = doTest(DOUBLE, NULLABLE_ANY) + fun testMapPrimitiveToPrimitive() = doTest(LONG, DOUBLE) + + fun testFewTransitions() = doTest(NULLABLE_ANY, INT, NULLABLE_ANY, LONG, DOUBLE) +}