From 14ef19418b137938d265f015c4e604e06fd46cb0 Mon Sep 17 00:00:00 2001 From: "Vitaliy.Bibaev" Date: Fri, 24 Nov 2017 14:59:50 +0300 Subject: [PATCH] Add tests on different types of chain source --- .../exec/collection/outs/arrayAsSource.out | 17 +++++++++++++++++ .../exec/collection/outs/collectionAsSource.out | 17 +++++++++++++++++ .../collection/outs/primitiveArrayAsSource.out | 17 +++++++++++++++++ .../exec/collection/outs/stringAsSource.out | 17 +++++++++++++++++ .../exec/collection/src/source/ArrayAsSource.kt | 6 ++++++ .../collection/src/source/CollectionAsSource.kt | 7 +++++++ .../src/source/PrimitiveArrayAsSource.kt | 6 ++++++ .../collection/src/source/StringAsSource.kt | 6 ++++++ .../exec/collection/DifferentSourceTest.kt | 11 +++++++++++ 9 files changed, 104 insertions(+) create mode 100644 idea/testData/debugger/sequence/exec/collection/outs/arrayAsSource.out create mode 100644 idea/testData/debugger/sequence/exec/collection/outs/collectionAsSource.out create mode 100644 idea/testData/debugger/sequence/exec/collection/outs/primitiveArrayAsSource.out create mode 100644 idea/testData/debugger/sequence/exec/collection/outs/stringAsSource.out create mode 100644 idea/testData/debugger/sequence/exec/collection/src/source/ArrayAsSource.kt create mode 100644 idea/testData/debugger/sequence/exec/collection/src/source/CollectionAsSource.kt create mode 100644 idea/testData/debugger/sequence/exec/collection/src/source/PrimitiveArrayAsSource.kt create mode 100644 idea/testData/debugger/sequence/exec/collection/src/source/StringAsSource.kt create mode 100644 idea/tests/com/intellij/debugger/streams/kotlin/exec/collection/DifferentSourceTest.kt diff --git a/idea/testData/debugger/sequence/exec/collection/outs/arrayAsSource.out b/idea/testData/debugger/sequence/exec/collection/outs/arrayAsSource.out new file mode 100644 index 00000000000..98685fed685 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/outs/arrayAsSource.out @@ -0,0 +1,17 @@ +LineBreakpoint created at ArrayAsSource.kt:5 +Run Java +Connected to the target VM +ArrayAsSource.kt:5 +arrayOf("23", "34").asIterable() +.count() +count + before: 2 + after: nothing +mappings for count + direct: + 2 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/collection/outs/collectionAsSource.out b/idea/testData/debugger/sequence/exec/collection/outs/collectionAsSource.out new file mode 100644 index 00000000000..88f9f2e5e24 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/outs/collectionAsSource.out @@ -0,0 +1,17 @@ +LineBreakpoint created at CollectionAsSource.kt:6 +Run Java +Connected to the target VM +CollectionAsSource.kt:6 +collection +.count({ it == 3 }) +count + before: 4 + after: nothing +mappings for count + direct: + 4 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/collection/outs/primitiveArrayAsSource.out b/idea/testData/debugger/sequence/exec/collection/outs/primitiveArrayAsSource.out new file mode 100644 index 00000000000..62497cffd92 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/outs/primitiveArrayAsSource.out @@ -0,0 +1,17 @@ +LineBreakpoint created at PrimitiveArrayAsSource.kt:5 +Run Java +Connected to the target VM +PrimitiveArrayAsSource.kt:5 +booleanArrayOf(true, false).asIterable() +.count() +count + before: 2 + after: nothing +mappings for count + direct: + 2 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/collection/outs/stringAsSource.out b/idea/testData/debugger/sequence/exec/collection/outs/stringAsSource.out new file mode 100644 index 00000000000..5f16fb02d16 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/outs/stringAsSource.out @@ -0,0 +1,17 @@ +LineBreakpoint created at StringAsSource.kt:5 +Run Java +Connected to the target VM +StringAsSource.kt:5 +"Hello World!" +.count({ it.isUpperCase() }) +count + before: 12 + after: nothing +mappings for count + direct: + 12 -> nothing + reverse: + empty +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/idea/testData/debugger/sequence/exec/collection/src/source/ArrayAsSource.kt b/idea/testData/debugger/sequence/exec/collection/src/source/ArrayAsSource.kt new file mode 100644 index 00000000000..f76fc211bb8 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/src/source/ArrayAsSource.kt @@ -0,0 +1,6 @@ +package source + +fun main(args: Array) { + // Breakpoint! + arrayOf("23", "34").count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/exec/collection/src/source/CollectionAsSource.kt b/idea/testData/debugger/sequence/exec/collection/src/source/CollectionAsSource.kt new file mode 100644 index 00000000000..84f0708d795 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/src/source/CollectionAsSource.kt @@ -0,0 +1,7 @@ +package source + +fun main(args: Array) { + val collection: Collection = listOf(1, 2, 3, 5) + // Breakpoint! + collection.count { it == 3 } +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/exec/collection/src/source/PrimitiveArrayAsSource.kt b/idea/testData/debugger/sequence/exec/collection/src/source/PrimitiveArrayAsSource.kt new file mode 100644 index 00000000000..1ad6b9687b9 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/src/source/PrimitiveArrayAsSource.kt @@ -0,0 +1,6 @@ +package source + +fun main(args: Array) { + // Breakpoint! + booleanArrayOf(true, false).count() +} \ No newline at end of file diff --git a/idea/testData/debugger/sequence/exec/collection/src/source/StringAsSource.kt b/idea/testData/debugger/sequence/exec/collection/src/source/StringAsSource.kt new file mode 100644 index 00000000000..51087e09b4c --- /dev/null +++ b/idea/testData/debugger/sequence/exec/collection/src/source/StringAsSource.kt @@ -0,0 +1,6 @@ +package source + +fun main(args: Array) { + // Breakpoint! + "Hello World!".count { it.isUpperCase() } +} \ No newline at end of file diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/exec/collection/DifferentSourceTest.kt b/idea/tests/com/intellij/debugger/streams/kotlin/exec/collection/DifferentSourceTest.kt new file mode 100644 index 00000000000..a6cceee8fa0 --- /dev/null +++ b/idea/tests/com/intellij/debugger/streams/kotlin/exec/collection/DifferentSourceTest.kt @@ -0,0 +1,11 @@ +package com.intellij.debugger.streams.kotlin.exec.collection + +/** + * @author Vitaliy.Bibaev + */ +class DifferentSourceTest : CollectionTestCase("source") { + fun testCollectionAsSource() = doTestWithResult() + fun testStringAsSource() = doTestWithResult() + fun testArrayAsSource() = doTestWithResult() + fun testPrimitiveArrayAsSource() = doTestWithResult() +} \ No newline at end of file