Add generated tests for collections/java streams

This commit is contained in:
Vitaliy.Bibaev
2018-06-08 09:46:15 +03:00
committed by Yan Zhulanow
parent cf2c2ed802
commit d4795c0e5d
58 changed files with 56 additions and 192 deletions
@@ -1,17 +0,0 @@
LineBreakpoint created at AllMatchFalse.kt:5
Run Java
Connected to the target VM
AllMatchFalse.kt:5
listOf(1, 2)
.all({ it % 2 == 0 })
all
before: 2
after: nothing
mappings for all
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at AllMatchTrue.kt:5
Run Java
Connected to the target VM
AllMatchTrue.kt:5
listOf(1, 2)
.all({ it < 10 })
all
before: 2
after: nothing
mappings for all
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
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
@@ -1,17 +0,0 @@
LineBreakpoint created at Average.kt:5
Run Java
Connected to the target VM
Average.kt:5
listOf(1, 2, 3, 4)
.average()
average
before: 4
after: nothing
mappings for average
direct:
4 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
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
@@ -1,17 +0,0 @@
LineBreakpoint created at Distinct.kt:5
Run Java
Connected to the target VM
Distinct.kt:5
listOf(1, 2, 3, 4, 3, 2, 1)
.distinct()
distinct
before: 7
after: nothing
mappings for distinct
direct:
7 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at DistinctBy.kt:5
Run Java
Connected to the target VM
DistinctBy.kt:5
listOf(1, 2, 3, 4, 5)
.distinctBy({ it % 2 })
distinctBy
before: 5
after: nothing
mappings for distinctBy
direct:
5 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,18 +0,0 @@
LineBreakpoint created at FilterAsIntermediate.kt:5
Run Java
Connected to the target VM
FilterAsIntermediate.kt:5
listOf("abc", "bde", "gh")
.filter({ it.length < 3 })
.count()
filter
before: 4,6,8
after: 8
count
before: 10
after: nothing
Exception caught: junit.framework.AssertionFailedError, null
Disconnected from the target VM
WRONG!
Process finished with exit code 0
@@ -1,21 +0,0 @@
LineBreakpoint created at FilterAsTerminal.kt:5
Run Java
Connected to the target VM
FilterAsTerminal.kt:5
listOf("23", "54", "4543")
.filter({ it.length < 3 })
filter
before: 4,6,8
after: 4,6
mappings for filter
direct:
4 -> 4
6 -> 6
8 -> nothing
reverse:
4 <- 4
6 <- 6
Disconnected from the target VM
WRONG!
Process finished with exit code 0
@@ -1,29 +0,0 @@
LineBreakpoint created at FilterPassNothing.kt:5
Run Java
Connected to the target VM
FilterPassNothing.kt:5
listOf(Any(), Any(), Any())
.filter({ false })
.count()
filter
before: 4,6,8
after: nothing
count
before: nothing
after: nothing
mappings for filter
direct:
4 -> nothing
6 -> nothing
8 -> nothing
reverse:
empty
mappings for count
direct:
empty
reverse:
empty
Disconnected from the target VM
WRONG!
Process finished with exit code 0
@@ -1,18 +0,0 @@
LineBreakpoint created at FilterPrimitive.kt:5
Run Java
Connected to the target VM
FilterPrimitive.kt:5
listOf(1, 2, 3)
.filter({ it == 2 })
.count()
filter
before: 4,6,8
after: 6
count
before: 10
after: nothing
Exception caught: junit.framework.AssertionFailedError, null
Disconnected from the target VM
WRONG!
Process finished with exit code 0
@@ -1,20 +0,0 @@
LineBreakpoint created at FilterPrimitiveAsTermination.kt:5
Run Java
Connected to the target VM
FilterPrimitiveAsTermination.kt:5
byteArrayOf(1, 3, 50).asIterable()
.filter({ it == 50.toByte() })
filter
before: 4,6,8
after: 8
mappings for filter
direct:
4 -> nothing
6 -> nothing
8 -> 8
reverse:
8 <- 8
Disconnected from the target VM
WRONG!
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at FlatMap.kt:5
Run Java
Connected to the target VM
FlatMap.kt:5
listOf(2, 3)
.flatMap({ 0..it })
flatMap
before: 2
after: nothing
mappings for flatMap
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at GroupBy.kt:5
Run Java
Connected to the target VM
GroupBy.kt:5
listOf(1, 2, 3, 4, 5)
.groupBy({ it % 2 })
groupBy
before: 5
after: nothing
mappings for groupBy
direct:
5 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at IndexOf.kt:5
Run Java
Connected to the target VM
IndexOf.kt:5
listOf(1, 2)
.indexOf(2)
indexOf
before: 2
after: nothing
mappings for indexOf
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at Map.kt:5
Run Java
Connected to the target VM
Map.kt:5
listOf(1, 2)
.map({ it * it })
map
before: 2
after: nothing
mappings for map
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,18 +0,0 @@
LineBreakpoint created at MapToSameCollection.kt:6
Run Java
Connected to the target VM
MapToSameCollection.kt:6
listOf(4, 5, 6)
.mapTo(dst, { it * it })
mapTo
before: 3
after: nothing
mappings for mapTo
direct:
3 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
[1, 2, 3, 16, 25, 36, 16, 25, 36, 1, 4, 9, 625, 625]
@@ -1,17 +0,0 @@
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
@@ -1,17 +0,0 @@
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
@@ -1,17 +0,0 @@
LineBreakpoint created at ZipWithGreater.kt:5
Run Java
Connected to the target VM
ZipWithGreater.kt:5
listOf(1, 2)
.zip(listOf(1, 4, 8))
zip
before: 2
after: nothing
mappings for zip
direct:
2 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at ZipWithLesser.kt:5
Run Java
Connected to the target VM
ZipWithLesser.kt:5
listOf(1, 2, 3)
.zip(listOf(1, 4))
zip
before: 3
after: nothing
mappings for zip
direct:
3 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,17 +0,0 @@
LineBreakpoint created at ZipWithSame.kt:5
Run Java
Connected to the target VM
ZipWithSame.kt:5
listOf(1, 2, 3)
.zip(listOf(1, 4, 8))
zip
before: 3
after: nothing
mappings for zip
direct:
3 -> nothing
reverse:
empty
Disconnected from the target VM
Process finished with exit code 0
@@ -1,6 +0,0 @@
package checks
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2).all { it % 2 == 0 }
}
@@ -1,6 +0,0 @@
package checks
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2).all { it < 10 }
}
@@ -1,6 +0,0 @@
package distinct
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3, 4, 3, 2, 1).distinct()
}
@@ -1,6 +0,0 @@
package distinct
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3, 4, 5).distinctBy { it % 2 }
}
@@ -1,6 +0,0 @@
package filter
fun main(args: Array<String>) {
// Breakpoint!
listOf("abc", "bde", "gh").filter { it.length < 3 }.count()
}
@@ -1,6 +0,0 @@
package filter
fun main(args: Array<String>) {
// Breakpoint!
listOf("23", "54", "4543").filter { it.length < 3 }
}
@@ -1,6 +0,0 @@
package filter
fun main(args: Array<String>) {
// Breakpoint!
listOf(Any(), Any(), Any()).filter { false }.count()
}
@@ -1,6 +0,0 @@
package filter
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3).filter { it == 2 }.count()
}
@@ -1,6 +0,0 @@
package filter
fun main(args: Array<String>) {
// Breakpoint!
byteArrayOf(1, 3, 50).filter { it == 50.toByte() }
}
@@ -1,6 +0,0 @@
package final
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3, 4).average()
}
@@ -1,6 +0,0 @@
package flatMap
fun main(args: Array<String>) {
// Breakpoint!
listOf(2, 3).flatMap { 0..it }
}
@@ -1,6 +0,0 @@
package grouping
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3, 4, 5).groupBy { it % 2 }
}
@@ -1,6 +0,0 @@
package map
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2).map { it * it }
}
@@ -1,8 +0,0 @@
package map
fun main(args: Array<String>) {
val dst = mutableListOf(1, 2, 3)
// Breakpoint!
listOf(4, 5, 6).mapTo(dst, { it * it }).filter { it % 4 != 0 }.mapTo(dst, { it * it })
println(dst)
}
@@ -1,6 +0,0 @@
package misc
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2).indexOf(2)
}
@@ -1,6 +0,0 @@
package source
fun main(args: Array<String>) {
// Breakpoint!
arrayOf("23", "34").count()
}
@@ -1,7 +0,0 @@
package source
fun main(args: Array<String>) {
val collection: Collection<Any> = listOf(1, 2, 3, 5)
// Breakpoint!
collection.count { it == 3 }
}
@@ -1,6 +0,0 @@
package source
fun main(args: Array<String>) {
// Breakpoint!
booleanArrayOf(true, false).count()
}
@@ -1,6 +0,0 @@
package source
fun main(args: Array<String>) {
// Breakpoint!
"Hello World!".count { it.isUpperCase() }
}
@@ -1,6 +0,0 @@
package zip
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2).zip(listOf(1, 4, 8))
}
@@ -1,6 +0,0 @@
package zip
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3).zip(listOf(1, 4))
}
@@ -1,6 +0,0 @@
package zip
fun main(args: Array<String>) {
// Breakpoint!
listOf(1, 2, 3).zip(listOf(1, 4, 8))
}