[PowerAssert] Add codegen tests
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
Assertion failed
|
||||
assert(object { override fun toString() = "ANONYMOUS" }.toString() == "toString()")
|
||||
| | |
|
||||
| | false
|
||||
| ANONYMOUS
|
||||
ANONYMOUS
|
||||
@@ -0,0 +1,3 @@
|
||||
fun box() = expectThrowableMessage {
|
||||
assert(object { override fun toString() = "ANONYMOUS" }.toString() == "toString()")
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Assertion failed
|
||||
assert(list.map { "Doe, $it" }.any { it == "Scott, Michael" })
|
||||
| | |
|
||||
| | false
|
||||
| [Doe, Jane, Doe, John]
|
||||
[Jane, John]
|
||||
@@ -0,0 +1,4 @@
|
||||
fun box() = expectThrowableMessage {
|
||||
val list = listOf("Jane", "John")
|
||||
assert(list.map { "Doe, $it" }.any { it == "Scott, Michael" })
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Assertion failed
|
||||
require(
|
||||
value = list
|
||||
|
|
||||
[Jane, John]
|
||||
.map { "Doe, $it" }
|
||||
|
|
||||
[Doe, Jane, Doe, John]
|
||||
.any { it == "Scott, Michael" }
|
||||
|
|
||||
false
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
// FUNCTION: kotlin.require
|
||||
|
||||
fun box() = expectThrowableMessage {
|
||||
val list = listOf("Jane", "John")
|
||||
require(
|
||||
value = list
|
||||
.map { "Doe, $it" }
|
||||
.any { it == "Scott, Michael" }
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user