Debugger tests: specify expression for evaluate expression test when test failed
This commit is contained in:
+5
-5
@@ -41,21 +41,21 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestC
|
|||||||
createDebugProcess(path)
|
createDebugProcess(path)
|
||||||
|
|
||||||
onBreakpoint {
|
onBreakpoint {
|
||||||
val exceptions = arrayListOf<Throwable>()
|
val exceptions = linkedMapOf<String, Throwable>()
|
||||||
for ((i, expression) in expressions.withIndices()) {
|
for ((i, expression) in expressions.withIndices()) {
|
||||||
try {
|
try {
|
||||||
evaluate(expression, expectedResults[i])
|
evaluate(expression, expectedResults[i])
|
||||||
}
|
}
|
||||||
catch (e: Throwable) {
|
catch (e: Throwable) {
|
||||||
exceptions.add(e)
|
exceptions.put(expression, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exceptions.notEmpty) {
|
if (!exceptions.empty) {
|
||||||
for (exc in exceptions) {
|
for (exc in exceptions.values()) {
|
||||||
exc.printStackTrace()
|
exc.printStackTrace()
|
||||||
}
|
}
|
||||||
throw AssertionError("Test failed:\n" + exceptions.map { it.getMessage() }.makeString("\n"))
|
throw AssertionError("Test failed:\n" + exceptions.map { "expression: ${it.key}, exception: ${it.value.getMessage()}" }.makeString("\n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finish()
|
finish()
|
||||||
|
|||||||
Reference in New Issue
Block a user