Add tests for appending values to sequence operation
This commit is contained in:
committed by
Yan Zhulanow
parent
d30a3b2495
commit
53209eaeec
@@ -0,0 +1,38 @@
|
|||||||
|
LineBreakpoint created at PlusArray.kt:5
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
PlusArray.kt:5
|
||||||
|
listOf(1, 2, 3).asSequence()
|
||||||
|
.plus(arrayOf(3, 4, 5))
|
||||||
|
.count()
|
||||||
|
plus
|
||||||
|
before: 1,3,5
|
||||||
|
after: 2,4,6,7,8,9
|
||||||
|
count
|
||||||
|
before: 2,4,6,7,8,9
|
||||||
|
after: nothing
|
||||||
|
mappings for plus
|
||||||
|
direct:
|
||||||
|
1 -> 2
|
||||||
|
3 -> 4
|
||||||
|
5 -> 6
|
||||||
|
reverse:
|
||||||
|
1 <- 2
|
||||||
|
3 <- 4
|
||||||
|
5 <- 6
|
||||||
|
nothing <- 7
|
||||||
|
nothing <- 8
|
||||||
|
nothing <- 9
|
||||||
|
mappings for count
|
||||||
|
direct:
|
||||||
|
2 -> nothing
|
||||||
|
4 -> nothing
|
||||||
|
6 -> nothing
|
||||||
|
7 -> nothing
|
||||||
|
8 -> nothing
|
||||||
|
9 -> nothing
|
||||||
|
reverse:
|
||||||
|
empty
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
LineBreakpoint created at PlusElement.kt:5
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
PlusElement.kt:5
|
||||||
|
sequenceOf(1, 2)
|
||||||
|
.plusElement(10)
|
||||||
|
.count()
|
||||||
|
plusElement
|
||||||
|
before: 1,3
|
||||||
|
after: 2,4,5
|
||||||
|
count
|
||||||
|
before: 2,4,5
|
||||||
|
after: nothing
|
||||||
|
mappings for plusElement
|
||||||
|
direct:
|
||||||
|
1 -> 2
|
||||||
|
3 -> 4
|
||||||
|
reverse:
|
||||||
|
1 <- 2
|
||||||
|
3 <- 4
|
||||||
|
nothing <- 5
|
||||||
|
mappings for count
|
||||||
|
direct:
|
||||||
|
2 -> nothing
|
||||||
|
4 -> nothing
|
||||||
|
5 -> nothing
|
||||||
|
reverse:
|
||||||
|
empty
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
LineBreakpoint created at PlusSequence.kt:5
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
PlusSequence.kt:5
|
||||||
|
sequenceOf(10, 20)
|
||||||
|
.plus(sequenceOf(30, 40))
|
||||||
|
.count()
|
||||||
|
plus
|
||||||
|
before: 1,3
|
||||||
|
after: 2,4,5,6
|
||||||
|
count
|
||||||
|
before: 2,4,5,6
|
||||||
|
after: nothing
|
||||||
|
mappings for plus
|
||||||
|
direct:
|
||||||
|
1 -> 2
|
||||||
|
3 -> 4
|
||||||
|
reverse:
|
||||||
|
1 <- 2
|
||||||
|
3 <- 4
|
||||||
|
nothing <- 5
|
||||||
|
nothing <- 6
|
||||||
|
mappings for count
|
||||||
|
direct:
|
||||||
|
2 -> nothing
|
||||||
|
4 -> nothing
|
||||||
|
5 -> nothing
|
||||||
|
6 -> nothing
|
||||||
|
reverse:
|
||||||
|
empty
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
LineBreakpoint created at PlusSingle.kt:5
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
PlusSingle.kt:5
|
||||||
|
sequenceOf(10, 20)
|
||||||
|
.plus(30)
|
||||||
|
.count()
|
||||||
|
plus
|
||||||
|
before: 1,3
|
||||||
|
after: 2,4,5
|
||||||
|
count
|
||||||
|
before: 2,4,5
|
||||||
|
after: nothing
|
||||||
|
mappings for plus
|
||||||
|
direct:
|
||||||
|
1 -> 2
|
||||||
|
3 -> 4
|
||||||
|
reverse:
|
||||||
|
1 <- 2
|
||||||
|
3 <- 4
|
||||||
|
nothing <- 5
|
||||||
|
mappings for count
|
||||||
|
direct:
|
||||||
|
2 -> nothing
|
||||||
|
4 -> nothing
|
||||||
|
5 -> nothing
|
||||||
|
reverse:
|
||||||
|
empty
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package append
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
listOf(1, 2, 3).asSequence().plus(arrayOf(3, 4, 5)).count()
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package append
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
sequenceOf(1, 2).plusElement(10).count()
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package append
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
sequenceOf(10, 20).plus(sequenceOf(30, 40)).count()
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package append
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
sequenceOf(10, 20).plus(30).count()
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// 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 AppendOperationsTest : OperationsTestCase("append") {
|
||||||
|
fun testPlusSingle() = doTestWithResult()
|
||||||
|
fun testPlusArray() = doTestWithResult()
|
||||||
|
fun testPlusSequence() = doTestWithResult()
|
||||||
|
|
||||||
|
fun testPlusElement() = doTestWithResult()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user