Skip to content

Commit c65fb00

Browse files
committed
Style
1 parent fb681a7 commit c65fb00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kotlinx-coroutines-debug/test/StacktraceUtils.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ package kotlinx.coroutines.debug
77
import java.io.*
88
import kotlin.test.*
99

10+
private val coroutineCreationFrameRegex =
11+
Regex("\n\tat kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation[^\n]*\n")
12+
1013
public fun String.trimStackTrace(): String =
1114
trimIndent()
1215
.replace(Regex(":[0-9]+"), "")
@@ -87,8 +90,8 @@ public fun verifyDump(vararg traces: String, ignoredCoroutine: String? = null) {
8790
return@forEach
8891
}
8992

90-
val expected = traces[index].split(Regex("\n\tat kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation[^\n]*\n"), limit = 2)
91-
val actual = value.split(Regex("\n\tat kotlinx.coroutines.debug.ArtificialStackFrames.coroutineCreation[^\n]*\n"), limit = 2)
93+
val expected = traces[index].split(coroutineCreationFrameRegex, limit = 2)
94+
val actual = value.split(coroutineCreationFrameRegex, limit = 2)
9295
assertEquals(expected.size, actual.size, "Creation stacktrace should be part of the expected input")
9396

9497
actual.zip(expected).forEach { (actualTrace, expectedTrace) ->

0 commit comments

Comments
 (0)