@@ -82,20 +82,20 @@ public fun verifyDump(vararg traces: String, ignoredCoroutine: String? = null) {
82
82
return
83
83
}
84
84
// Drop "Coroutine dump" line
85
- trace.withIndex().drop( 1 ).forEach { (index, value) ->
85
+ trace.drop( 1 ).withIndex( ).forEach { (index, value) ->
86
86
if (ignoredCoroutine != null && value.contains(ignoredCoroutine)) {
87
87
return @forEach
88
88
}
89
89
90
- val expected = traces[index - 1 ].split(" \n\t at kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation(ArtificialStackFrames.kt) \n " , limit = 2 )
91
- val actual = value.split(" \n\t at kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation(ArtificialStackFrames.kt) \n " , limit = 2 )
90
+ val expected = traces[index].split(Regex ( " \n\t at kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation[^ \n ]* \n " ) , limit = 2 )
91
+ val actual = value.split(Regex ( " \n\t at kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation[^ \n ]* \n " ) , limit = 2 )
92
92
assertEquals(expected.size, actual.size, " Creation stacktrace should be part of the expected input" )
93
93
94
- expected.withIndex( ).forEach { (index, trace ) ->
95
- val actualTrace = actual[index] .trimStackTrace().sanitizeAddresses()
96
- val expectedTrace = trace .trimStackTrace().sanitizeAddresses()
97
- val actualLines = cleanBlockHoundTraces(actualTrace .split(" \n " ))
98
- val expectedLines = expectedTrace .split(" \n " )
94
+ actual.zip(expected ).forEach { (actualTrace, expectedTrace ) ->
95
+ val sanitizedActualTrace = actualTrace .trimStackTrace().sanitizeAddresses()
96
+ val sanitizedExpectedTrace = expectedTrace .trimStackTrace().sanitizeAddresses()
97
+ val actualLines = cleanBlockHoundTraces(sanitizedActualTrace .split(" \n " ))
98
+ val expectedLines = sanitizedExpectedTrace .split(" \n " )
99
99
for (i in expectedLines.indices) {
100
100
assertEquals(expectedLines[i], actualLines[i])
101
101
}
0 commit comments